there's a number of ways to do it
We have exchange setup with a product called Faxination (made by fenestrae). You can have Active Directory contacts setup with a fax number, and when you email that specific contact it will reroute the email to the faxination server which will fax it to the phone number on that contact.
OR you can have some sort of local client installed that sees you're sending to a contact with a fax number and ask if you'd like to send a fax and have it route through internet to a host that does the actual faxing.