How does DRM work?

What happens in your browser when you stream Spotify or Netflix / The tyranny of Digital Rights Management