In short, Firefox does extra work to make sure that happens.
When you fire up Firefox, it checks if there is an existing Firefox in the same X11 session, using some X11 interprocess communication method. If it finds an existing Firefox, the new one just tells the existing one to do the work instead. I haven't checked the specifics on exactly what and how the latest Firefox versions behave, but this is the overall idea.
Most applications do not have, nor need, that kind of checking. Because Firefox has such a complex profile/session management, multiple instances modifying the profile at the same time is very fragile and difficult to get right. Instead of trying to do it that way, the developers chose to make sure there is always only one Firefox instance per (profile per) X11 session.
In your case, the X11 session is managed by the X11 server on your own workstation. When you connect to system B, and start Firefox there, it communicates with the X11 server on your own machine, and throws up the windows and whatnot on your own machine. Then, when you start Firefox locally, that instance notices there's already a Firefox running, so it tells the already running instance to do the work instead. Since Firefox uses the X11 communication methods, it does not matter that the already running version is actually running on B; they are still in the same X11 session, connected to the same X11 server.
On thin clients this means that any binary can reside on any server that is accessible via rsh or ssh. You can have one server dedicated for running browsers, another for eg. OpenOffice.org, and so on, without the users ever noticing anything (as long as the local binaries are diverged to start up the applications on the server instead). For large number of clients, that sort of optimization may provide surprising benefits, both because the servers can be optimized for a small number of applications, but also because Linux will usually only need one copy of the binaries in memory, leaving almost all memory for data and caches.
I hope you find this informative,
Nominal Animal