Who Writes the Backlog?

The Product Owner has the final say in backlog prioritization. But who writes the backlog? Is it always the product owner? My experience with Agile has been that, in the real world, the backlog contains two types of items: The "user stories" that discuss functionality from the perspective of an end user Technical stories--including things like technical debt, maintenance, package upgrades, etc.…