Using online gearing top speed calculators I realized that the bigger the diameter of the wheels, the higher the theoretical gearing top speed is. Why is that? Why does bigger wheel act as increasing the gear ratio and thus increasing the theoretical gearing top speed, does bigger wheels also reduce the torque going to the ground because it makes the gearing taller?
The answer lies in the rpm conversion to ground travel. Any gearing in a motor vehicle is designed to provide sufficient torque to begin moving (with load, of course) and to keep the engine in the appropriate rpm range.
Consider one thousand engine revolutions. The transmission converts that through the cogs and shafts and belts (CVT) and torque converters (automatic transmissions/locking) into a different value on the output shaft. Depending on the vehicle design, this revolution is then passed through a differential, which is going to change the value again.
Allowing for the incredibly high revolutions per minute of an internal combustion engine, the ratio will be substantial. As an example, Car & Driver magazine, November 2022, p.53, lists 5.2 miles per hour per 1000 rpm for the 2023 Toyota GR Corolla Circuit. This would represent the speed on the tested tires, Michelin Pilot Sport 4, 235/40ZR18. Sixty thousand revolutions during that hour traveling five point two miles calculates to about six inches for each engine revolution. An increase in tire diameter of approximately one-third of an inch adds an inch of travel.
Changing the tire size to something smaller would result in less distance traveled during that one hour and conversely, a larger tire would result in a greater distance traveled.
As you suggest, the effective gearing is also changed. The last mechanical conversion of the power train is the distance from the center of the wheel to the ground. A lever with a greater length (larger tire), pivoting from one end (wheel hub) requires more force to move the equivalent mass at the end (entire motor vehicle) than a smaller lever (smaller tire) does.
Small tires = more torque, less speed. Large tires = less torque, more speed.
This is obviously a simplification, but does factor in when one allows for the necessity to either re-calibrate one's speedometer or determine the speed change with a tire change.