This is quite a big topic, but once understood it is very simple and there is almost no room for error. How fast we are allowed to go through junctions is all part of a topic known as the "Anschließender Weichenbereich", which is an umbrella term for everything to do with speed limits in junctions and Stations (Bahnhof in rail jargon actually explicitly refers to a part of track that is seperate from the main line, and is confined to the space between the two entry main signals. I'd be extremely surprised if there was no british equivalent, but station seems to just be a term for somewhere there is a platform).
There are 2 golden rules to follow, and that's already a big chunk of the whole deal.
1) From an entry signal or "in between" main signal, the speed restriction is valid until the next main signal, or a scheduled stop before this main signal (in case of multiple, the last one).
2) From an exit or block signal, the speed restriction is valid until the last junction of the signal.
Do decide what function a main signal has, we have an overview of the route, along with where everything is, including the location of the last junction where applicable, but of course route knowledge also plays a part. Hp 1 means we can proceed at line speed. Hp 2 (alone) means we can proceed at 40 km/h, and this would be a speed restriction as a part of the "anschließender Weichenbereich". This speed can be altered with another signal, Zs 3, which is most commonly an electric signal but can also be a board (common on exit signals). From speeds between 10 and 60, Hp 2 is given, anything above is signalled with Hp 1. Hp 1 then means all the junctions are straight and so therefore there is no reason to reduce speed.
An example: The line is straight, but my train is diverging onto another route after a stop. So my entry signal would be Hp 1, with a warning signal showing Vr 2 (means the next main signal shows Hp 2). Hp 1 means I can continue at line speed (as a maximum obviously; I still need to stop at the platform!). After stopping and closing the doors, my exit signal is showing Hp 2, we can also throw in a Zs 3 that shows a "6". In Germany, all speed restrictions are that number multiplied by 10, so in this case I am allowed to proceed at 60 km/h. Eventually, I pass the last junction that belongs to the signal, and then I can proceed at the line speed again,
Another example: Pulling into a main station, my entry signal shows Hp 1 with a Zs 3 showing an "8". This means I can proceed with 80 km/h until the next main signal or my scheduled stop, whichever comes first. In this case, it is the scheduled stop, so after stopping I need a new signal. As it's a big station, there is an "in between" signal at the end of the platform, showing Hp 2. This gives me permission to go at 40 km/h until the next main signal, which is the exit signal. This shows Hp 1. Hp 1 means I can proceed at line speed, even if there are more junctions (as they are all set to a straight route that accomodates the line speed), so as soon as my entire train has passed the Hp 1, I can continue at line speed.
As for how we know where we are going, this is also all in the plan for the train number. Every train that I know of except the austrian locomotives, has a display dedicated entirely to showing this plan, although we do have Books in the cab with printed versions (that are a little more messy because all sorts of variables are included that can be filtered out with the electronic version, showing only information relevant to your train), and also since 2 years we have tablets where we can also download the train plan with about 30 seconds of work should the need arise. This includes to an extent the aspects certain signals must show to ensure we are on the right line. Route knowledge of course also plays a role.
Honestly, this is rather hard to explain without some kind of diagram or video to reference, and it would be easier if you had a plan of the route too. If there's enough demand, I wouldn't mind making a video on the matter however. There's a rather accurate train sim for the German system called "ZuSi 3" where I could easily demonstrate this, even in situations with signal failure. I hope this at least cleared something up, but I don't blame you at all if you're still confused!