Steam gifts explained: Send the right game to the right person
A Steam game gift is a purchase intended for somebody else. If you want to surprise a friend, pick the gift option during checkout rather than buying the copy for your own library. Steam's ordinary game-gifting flow lets you choose a recipient from your Steam friends and may let you schedule delivery. Check the exact account before completing the purchase, especially if your friends have a taste for near-identical display names.
Check the product before selecting it. A game, a deluxe edition, and an add-on are different purchases, and an add-on may need a base game. Valve notes that regional restrictions can apply to gifts, so do not assume a purchase made in one country can go to a friend whose account uses another region. Steam's checkout is the place to check eligibility for that recipient. If Steam won't allow a particular gift, don't buy it for yourself on the assumption that you'll be able to transfer it afterward.
A gift still has to be accepted. If a recipient declines it or doesn't redeem it within Steam's stated window, Valve's support page describes how the purchase is refunded. Make sure the date makes sense if you plan to send the game later, and keep the receipt until the correct person has received it. Gift purchases and Steam Families are separate features. Sharing access to a game is not the same as giving the other account a copy it owns.
Before sending, confirm three things: the game and edition, the actual recipient's Steam account, and the total being charged. If the friend only said they wanted the game in passing, checking whether they already own it elsewhere can prevent a well-meant duplicate. Steam makes the mechanics of buying a gift easy enough. Most of the trouble comes from not stopping to check who is actually at the other end.
Source: Valve’s Steam Support FAQ on Steam Gifts.
Updated