I'm curious!
But do they actually do any good?
Short answer: yes.
Long answer: would require a college course in electromagnetic theory.
Middle-size answer: I am sure you have seen someone make bread. Part way through the process there is a big ball of dough in the middle of the kitchen table.
Imagine that ball as representing the way an infinitely-small antenna ("isotropic") would radiate radio frequency (RF) energy--a sphere centered on the antenna and extending equally in all directions. The amount of radio power is represented by the amount of dough. The extents of the sphere could stand for the usable range of the radio.
Now press your fist down in the middle of that ball. The center will get thinner, representing less energy (lower signal strength) above and below the antenna. But in return, the edges spread farther out--more signal in a horizontal direction (at right angles to the antenna's axis). The amount of bread dough (RF power) has not changed, but more of it re-directed from above and below and spread out sideways instead.
This is independent of the radio power--an antenna with gain does not change the power, but rather "Effective Radiated Power" (ERP) in some favored direction. And the good news is that the same gain applies to received signals as well, certainly an advantage because the remote client has to be able to speak back to the router.
It is also possible to direct the signal into an even smaller area. Think of how a small reflector in a flashlight concentrates the light from that tiny bulb into a brighter beam in the direction you point it. Radio antennas can do the same--parabolic reflectors make it possible for low-powered transmitters in an orbit 22,500 miles above the equator to send TV signals to Earth. The same type of parabolic reflectors have enabled experimenters to send WiFi signals over 100 miles--but of course, only in a tightly managed beam.
"Beam forming" is different, but also takes advantage of antenna design. Multiple antennas fed at different phase angles can accomplish the same kind of focused transmission and reception. The direction is chosen by the phase differences between the antennas instead of increasing the gain of a given antenna.
Here is the point where a few experienced people jump in and say that this theory does not apply because the signal bounces all over the place anyway. But so does the light from a flashlight, and yet the advantage of a directed beam is easy to see. And light is also electromagnetic radiation, at a much shorter wavelength.