Hi, Guest.
In the sentences "I like these ones" and "I like those ones", "these" and "those" function as adjectives/determiners, and "ones" -a pronoun- is used instead of repeating the word "glasses".
In "I like these" and I like "those", "these" and "those" are used as pronouns, so "ones"...