I have played poker countless of times especially within a table of around 4-6 players. But then, there are some people I see that had played with only two players and no dealer. They get five-cards each and just like the original game, the winner is based on whoever gets high value or card ranking. Then, I don't know anything else. Can someone explain this to me? The mechanics.
You seem to be familiar with a certain variant, such as the famous Texas Hold'em (where you get dealt two cards and a number of five table cards, which are shared between players). Those variants are sometimes called "Poker" in circles where it's not ambiguous to do so (such as a playgroup that exclusively plays Texas Hold'em), but nevertheless have their own name.
The variant of dealing a full hand of cards to players is known as Straight Poker (or just "Poker", as it's the oldest variant). It's not a particularily interesting variant by comparison, and therefore has been adapted into a multitude of variants over time. As a result, the "original" variant isn't played a lot today.
In general, Poker variants can be played with any amount of players of two or more, and whether they use a seperate dealer or shuffling and dealing is done by one of the players is up to preference or the environment you play in.