How does the Proof of Stake consensus algorithm work in detail?

Given all the different implementations and discussions on Proof of Stake vs Proof of Work I find myself a bit overwhelmed trying to understand the heart of this consensus algorithm. I even failed trying looking into the code repositories to figure it out.

My question is simple: can we outline how the algorithm works and how it achieves consensus more in detail in this thread?