Active Directory Federation Servers (Ad FS) are use to connect the on premise infrastructure to the cloud. The cloud is Office 365 .
Before setting it up, it is important to know the number of users who are going be using it. Basically you have to setup a server farm within the internal network and AD FS proxy servers in the perimeter of the organization network. The proxy servers relay information from the AD FS server to Office 365.
This would basically give a user single Sign on capabilities and help him connect to Office 365 using the existing infrastructure.