Your final "hand" is considered the best that 5 of the total cards can come up with.
So if 3 players each have just Ace high, the next 4 cards are considered. If someone has a King while the others don't, they win it alone. If they all have K, Q, J, 9 from the community and 2-8 in their hold cards, then they have the same top 5 cards to complete their "hand", 6th and 7th cards are not considered, they would all split the pot.
Same for if 2 players have a straight 5 to 10. The best hand they can come up with while using 5 cards is the straight. Additional cards (ace vs two) are not considered, they would split the pot.