When you cast Divination from your hand, you’re losing a card (Divination itself), but after it resolves, you’ve gained two cards in your hand. Overall, you’ve gained a card. Opponents haven’t gained any cards, so you’ve gained card advantage. Conversely, when you cast Prosperity for X=4, you lose a card (Prosperity itself), but you gain four cards, for a net gain of three. However, even with just one opponent, that player will draw four cards, so that ends up being a total net loss of one card for you, which means Prosperity with X=4 was not card advantage.