This is simplifying things, but basically, power comes out of the transformer on one side of the coil, then goes through various switches (often in your thermostat) to supply power to activate the desired things. These things can be: heat request, manual fan request, or a/c request. Since many (but not all) thermostats require power to operate, they usually also get a lead from the other side of the 24vac coil. So, basically, the switches in the thermostat apply power to tell the system to generate heat/cooling, or to turn the fan on manually. Usually, the switch will not allow both heat request and cooling requests to occur simultaneously. Some fancier thermostats have multiple staging for heating, and those used for heat pumps may have an additional lead.
Now, what your HVAC plant does with those signals will vary depending on the model. Not all can support all of the possible inputs. On a two-wire system, it's just like a light switch, power is on one lead, and when the thermostat switch closes, it applies it to the heating plant. For cooling or fan, it needs to branch that signal out to additional switches and wires to get back to the HVAC system.
Most heating units automatically turn the fan on when required, but you can force it to stay on, if your system supports it, and you have a remote switch (often found on the thermostat).