WHAT FXO AND FXS IS
An FXO gateway converts the regular, public switched telephone network (PSTN) into one of VoIP variants. An FXS gateway does exactly the opposite - it takes VoIP signal and transforms it back to regular “phone line” signal.
IN OTHER WORDS
You can think of FXO/FXS pairs as a super-long extension cord - plug the “remote” telephone in and it feels and behaves just as if you were plugged in your main phone “socket”.
Between the two gateways lies the Internet and all voice traffic travels virtually cost-free (or rather, at the cost of the Internet connectivity which has already been paid for).
Using a FXO/FXS pair, the hypothetical New York/Maine company above can bridge the two offices together and literally put everyone on the same phone network, regardless of location.
The advantages of using FXO/FXS pairs are clear - they allow to “bridge” remote offices in a fairly seamless way with advanced functionality and to cut costs of such integration. The main disadvantage is that you still need a phone service (although you have the luxury of choosing the location where you get it). The second disadvantage is that high-end FXS/FXO gateways capable of handling dozens of lines cost significantly more than consumer-grade products.