> Taiwan and Hong Kong refer to PRC China as ‘mainlander’
It's a general thing in the broad Sinosphere. Even the Japanese refer to (PRC) Chinese as "mainlanders" (大陸人/だいりくじん †) despite, you know, it being a completely different country for much of history!
†: You'll notice this sometimes in Anime. For example, in Sayonara Zetsubou-sensei's first episode the students respond to the teacher's unusual name with "must be from the mainland (=China)".
In modern usage, the "mainland" modifier is often used to get around the sensitive Taiwan issue. Different people may disagree on who is included in "China", but "mainland China" unambiguously excludes Taiwan even in the PRC.
Another fun fact is that English is woefully inexpressive when it comes to the cultural complexities of the broader Chinese cultural sphere. For example, a Taiwanese (or immigrant Chinese) person might identify as "culturally" Chinese (华人) but not "nationally" Chinese (中国人). A lot of this stuff gets lost in translation and ends up offending people inadvertently, because there aren't different English words!
> As a western for some reason I thought this would be the opposite.
Hong Kong split from the mainland in the 1840s and has been largely culturally (not necessarily politically) independent since. Modern Taiwan is the result of the KMT retreat during the civil war a _century_ later, in the 1940s.
A mainlander visiting Hong Kong will feel like an American going to, say, the UK -- it will feel familiar but distinctly foreign. A mainlander visiting Taiwan will feel like an American going to, say, Canada --- it will feel quirky but kind of like home. The mainlander might struggle to chat with a Hong Kong local as many won't speak Mandarin, whereas in Taiwan, they will have no trouble engaging in a conversation, with maybe only occasionally realizing that the other person refers to what they would call a "microwave" as an "electronic range" (this is not a real example. A real example would be something like a mainlander referring to "topping up (a transit card)" as "recharging" the card while a Taiwanese might call it "adding value" to the card).