I only play occasional games of 0 A.D., against A.I.
As with the dozen of other strategy games I play, I tend to assume a lot of things about "standard" buildings and units. The standard here being that you would garrison units in buildings for temporary protection and healing.
For some special buildings, like temples, I will read the tooltips if I have not played for a while. But for common ones, barracks included, I have preconceived ideas about what they do and might not always check if I’m missing something. (barracks train soldiers, towers shoot arrows, houses increase population limit, etc.)
…
I just started a quick game to check, and the experience gain in garrison is obvious from the tooltip. I guess I missed in until then because building a barracks is something I do without really thinking about it, like some other common tasks during early game.
Sadly I have no good suggestions about places where this information could be shown to ensure it is not missed. Loading screens and their tips could have been a good place, but here loading times are so short that I do not have the time to read in full what they display.
A technology improving the experience gain would of course help in noticing that this is a thing, but this does not sound like enough of a reason to add a new technology.