The idea of STV is to choose a number of representatives in such a way that each elected candidate represents the same number of voters. Spare votes of candidates who have more than they need, and all the votes of candidates who have too few, are transferred according to the voters’ preferences until we have a set of elected candidates each with the same number of votes, a runner-up with fewer votes, with all other candidates having been excluded as having too few votes.
For this to work, all that is needed is that each voter lists the candidates in order of preference. The vote counting process is such that voters can safely give their real preferences: the transfer system ensures that their vote will not be wasted, whether their first preference is for a candidate without enough other support to be elected, or for a candidate so popular that their support is not needed. And, importantly, their lower preferences cannot count against their higher ones, because the fate of their higher preferences will have already been decided before their lower preferences are taken into account.