It does work believe it or not. It is something that plays to your subconscious. You will favor the slightly cheaper option even if you aren't aware of it.
even subconsciously $15.55 will not be that better than $15.56
but in a change from $20 to $19.99 the whole first number is smaller, and that gives our ape brains the feeling that it's not as expensive
to reveal the vibes your brain operates on, think about bigger numbers. Imagine yourself to be in kind of a rush, you want to buy something, but family is waiting, or you need to walk your dog, or maybe you're doing shopping before work, regular life stuff,
first scenario
an identical item is sold for $2920 in the first store you visit, and for $2970 in the second store you visit. The stores are an inconvenient travel time away from each other. Do you go back to the first store?
second scenario
now, an identical item is sold for $2975 in the first store you visit, and for $3025 in the second store you visit. The stores are still an inconvenient travel time away from each other. Do you go back to the first store?
though the difference is still $50, the jump from $2975 to $3025 feels more significant than $2920 to $2970. And obviously many of us will go back to get the cheaper option in both cases, but there's a lot of people on this planet who have money to spare but not the time, and a lot of other circumstances too, marketing people know it and will do their damnest to sway you to buy their product
I learned all about this in "thinking fast and slow" by Daniel Kahneman. He talks about system 1 and system 2, where system 1 is your kind of knee-jerk reaction to a thing (thinking fast), and system 2 is the contemplative and careful consideration of a thing (thinking slow).
I would argue that some people overly leverage system 1 (thinking fast) because it's generally easier, and takes less time and mental effort to do. Those that either can't, or are unwilling to engage system 2 in their day to day activities, will 100% fall for these kinds of misleading prices, since system 1 is cutting so many corners so that it can be fast and efficient (mostly on how much energy is used), that it skips a lot of the cognitive steps and goes right to the (often incorrect) conclusion. That $19.99 is $19 (or $10 in some cases).
In the book, they discuss that system 1 often gives the wrong information that is later rejected by system 2 when further consideration is given to a particular input/stimulus.
If someone isn't engaging system 2 as a check to ensure system 1 isn't lying to them, then shit like $19.99 seems cheaper than $20. It doesn't hold up to any scrutiny, but they're not targeting thoughtful people with these practices. For thoughtful people, there's functionally no difference between $19.99 and $20.
Yes, the difference is one cent, but given that one cent is so worthless in today's society, to the point that Canada stopped making one cent coins (and other countries have done so as well), there's functionally no difference between the prices.
One cent is only worth anything if it is combined with many other cents. The sum of those pennies becomes valuable when you conglomerate enough of them.