How does OAuth works ?

Can some one explain, how can we implement single signin whit the plugin OAuth Plugin.

For example  I have http://www.xyz.com and another elgg installed at http://sub.xyz.com.

Now i want to implement the single signin, Can someone explaing how to do this. Who can send request to the other installation, and how can i choose the server and client. ?