How demat works

How does the Demat system work compared to physical shareholding?,