Foreword:
Reiterating what is said in comments and hopefully elaborating on a few key points:
The specific mathematical concepts behind the underlying problem are those of cardinality of sets and bijective functions. These formalized concepts mirror how we think in the finite case and allow us to think beyond that as well in the infinite cases.
The purpose of the "Hilbert's Hotel" example is to show explicitly via way of visualization how our intuition from finite sets does not directly translate to infinite sets.
What is a bijection and what is meant by cardinality?
A bijective function is a function from a domain to a codomain where the following properties are satisfied:
- It is a function, i.e. every element in the domain maps to exactly one output in the codomain (e.g. each person can be in only one room at a time)
- It is a surjective function, i.e. every element in the codomain is mapped to by at least one element in the domain (e.g. every room has at least one person in it)
- It is an injective function, i.e. every element in the codomain is mapped to by at most one element in the domain (e.g. no room may have more than one person in it)
We say that if there exists a bijective function between two sets, that they "have the same cardinality" (i.e. they have the "same number of elements"). If the sets are called $A$ and $B$, we write that they have the same cardinality as $|A|=|B|$. (Other popular options exist, such as $\#A=\#B$ or $A\sim B$, etc... I will stick with $|A|=|B|$ through the rest of this post).
For example, if we have $50$ people and $50$ rooms, then we can come up with a bijective function pairing the people to the rooms so that exactly one person goes in each room.
What are some results for the finite case?
A few properties that you should be well familiar with for finite sets:
If $|A|=|B|$ and $A'\supsetneq A$, then $|A'|\gneq |B|$.
For example, if we have $50$ people and $50$ rooms, then we have a bijective function pairing people to rooms, but as soon as we add a $51$'st person, then we cannot come up with such a pairing. $51$ people and $50$ rooms, we will by the pigeonhole principle be forced to have some room with more than one person in it.
Similarly, if we had $50$ people and $51$ rooms, then we would have at least one empty room.
Indeed, these observations lead us to the following result:
If $A$ and $B$ are both finite sets and there exists an injective function from $A$ to $B$ which is not surjective then $|A|<|B|$ and no bijection exists between $A$ and $B$. Similarly if $A$ and $B$ are both finite sets and there exists a surjective function from $A$ to $B$ which is not injective then $|A|>|B|$ and no bijection exists.
The very point of Hilbert's Hotel is to show that the above result does not hold for infinite sets.
What really is the hotel story meant to portray?
Letting $P=\{p_1,p_2,p_3,\dots\}$ and $R=\{r_1,r_2,r_3,\dots\}$ be (countably) infinite sets and letting $f:P\to Q$ given by $f(p_i)=r_i$ be a bijective function between them...
(here, $P$ represents our set of hotel guests and $R$ our set of rooms, our bijection just says that the $i$'th person is in the $i$'th room)
...and let $P'=P\cup \{p'\}$ where $p'\notin P$...
(if we add another new person to the hotel)
...then the function $g$ between $P'$ and $R$ given by $g(x)=\begin{cases}r_1&\text{if}~x=p'\\r_{i+1}&\text{if}~x=p_i\end{cases}$ is a bijection, thereby proving that $P'$ and $R$ are of the same cardinality despite $P'\supsetneq P$.
(by shifting each person down a room and giving the new person the first room, we successfully pair the rooms and people again leaving no person without a room and leaving no room without a person such that each room has exactly one person)
Note that if we tried to do the same thing in a finite setting, then we would have had the "last person" try to change rooms to the next room, but there would not be a "next room" for him to go to. Since we are working with infinite sets however, such a "last person" does not exist and so this does not present a problem.
Could we do it without making people change rooms first?
Given $P=\{p_1,p_2,\dots\}$ and $R=\{r_1,r_2,\dots\}$ be our infinite sets, letting $P'=P\cup \{p'\}$ where $p'\notin P$, and letting $f~:~P\to R$ given by $f(p_i)=r_i$ be our bijective function between the two, you are asking if there exists a bijective function $g$ from $P'$ to $R$ such that $g(p_i)=f(p_i)=r_i$ for all $p_i\in P$.
The answer is no, we can not. Suppose that $g(p')\in R$. Then $g(p')=r_i$ for some $i$. But, since $f$ is a bijection, $f^{-1}$ exists, and so $g(p')=r_i=g(f^{-1}(r_i))=g(p_i)$ and so $r_i$ is mapped to by two elements, $p'$ and $p_i$.
That is to say, if we do not move the people around in the rooms, and tell our new person to find some room to enter, it would necessarily already have someone in it.
Again, this would have in the finite case shown to us that no bijection exists between the sets, but in the infinite case as shown earlier this does not matter, a bijection still exists.
How about that 50/50 ratio thing?
When babies first learn to count, they point to each object they count and say the next number in sequence. So long as they don't accidentally point to the same thing more than once and don't skip or mess up any numbers in their sequence, they are successful at saying how many of an object there are.
Extending this method of counting and taking out the middle man of using numbers, we could also check to see if there are the same number of one type of object as another by pointing to a pair, one of objectA and one of objectB, before taking them away, checking to make sure that we pair each of them up successfully.
That is in essence coming up with a bijection between the set of objects in the first set with the set of objects in the second set.
Further, in the finite case, we notice that if we have $|A|$ elements in set $A$ and we have $|B|$ elements in set $B$ and $A$ and $B$ are disjoint sets, then $\frac{|A|}{|A\cup B|}=\frac{1}{2}=50\%$.
We also notice in the finite case that if $|A|\neq |B|$ then $\frac{|A|}{|A\cup B|}\neq \frac{1}{2}$.
As we move to the infinite case, things can get much weirder. If $A$ is infinite, then $|A|$ is infinity, but arithmetic with infinity is not well defined. We would have had $\frac{|A|}{|A\cup B|}=\frac{\infty}{\infty}$ which could be literally anything. You might try to say that it would be better written as $\frac{\infty}{2\cdot \infty}=\frac{1}{2}$ but that is not entirely correct.
You might try to say for instance that "Only half of all positive integers are even" and so there are "more" positive integers than positive even integers. In terms of that $\{1,2,3,4,\dots\}\supsetneq \{2,4,6,\dots\}$ you are correct, the positive integers strictly contains the positive even integers as a subset. In terms of cardinality however, they are considered to be the same size. That is because the function $f:\Bbb N\to 2\Bbb N$ given by $f(n)=2n$ is a bijection between those sets.
You might also say that there are "more positive integers which are not multiples of 3 than positive integers which are multiples of 3." In terms of relative density when looking at the numbers written in the usual order, $1,2,\color{blue}{3},4,5,\color{blue}{6},7,8,\color{blue}{9},\dots$ you might be correct. But, notice that I could have written the numbers in a different order: $1,\color{blue}{3},2,\color{blue}{6},4,\color{blue}{9},5,\color{blue}{12},7,\color{blue}{15},\dots$ where I alternate between writing the next multiple of $3$ and the next non-multiple of $3$.
Having a convenient way to pair things is nice, but if the pairing you are looking at doesn't have the desired property it does not automatically preclude a different pairing from existing in the infinite case even though it does in the finite case.