In Agile, the backlog is basically a list of all the user stories that are part of the project. It is not a static document but a living document that can change over time as the team adds more to it or removes from it as the team sees fit (“backlog grooming”).
Ideally higher priority user stories should be sitting at the top of the backlog, ready for the team to transfer them into a Sprint but having the backlog organized and prioritized is not a hard rule in Agile, it just makes the process easier and allows the team to focus their attention on the user stories at the top of the backlog (the higher priority ones). But that doesn’t mean that the team has to pick them in that order, they could for example pick the 1st one, the 5th one and the 8th one if that makes more sense for a particular Sprint.
Want to learn more about Agile? Read this EBOOK, listen to this AUDIOBOOK or enroll in this COURSE