The prices are the item's basic value (what is displayed in the inventory and info screens) and the barter menu shows what they are willing to ask/pay. I don't know the exact mechanics behind it but it's typically a multiplier to the trader's advantage, so something like 50% would see the trader ask 150 gold for something whose base price is 100 and pay 67 if you're selling it. IME the rates are a lot worse than that!
I don't know D&D at all but in other games the multiplier can vary by trader, by their proficiency, by their attitude to you and by the commodity in question, i.e. whether it is something they choose to trade in and its availability. Buy and sell prices don't necessarily have the same multiplier.
I don't know how BG3 does it and none of the above necessarily applies; it's just to illustrate that the actual price can be quite different to the "list price" and the reasons can be opaque.