Adult / Child / Mental Health / Learning Disabilities are the 4 'branches' of nursing. Within each branch there are specialities of practice, such as sexual health, infection control, eating disorders, advocacy, addiction, the list is pretty much endless.
The branch-specific Pre-reg course gives you the training and registration in the branch of nursing of your choice. Once you have that initial training and registration, you can start your career and explore different areas (specialities) of your branch of nursing and specialise further if you want to. Your initial pre-reg course placements will give you some experience of different settings and specialities (you need this for evidence for your NMC PIN), so you'll probably have some idea of areas you prefer and those you don't enjoy as much by the time you graduate.
The Uni of Birmingham nursing undergraduate course used to be a bit different to most in that they had a 'general' first year and then you chose your branch in the second year, which struck me as a good idea. Most other courses make you choose at the application stage. I'm not sure if they still do it that way though this was around 2018 and the NMC requirements/curriculum have since changed, so the course may have had to be amended alongside. Obviously the MSc courses have to condense the knowledge into 2yrs rather than 3 so there isn't time for this route anyway but it I liked it when I heard about it.