Bitcoin uses peer-2-peer connections to share the transaction database called the “Blockchain.” When users connect via P2P the other nodes they are connected to have a record of the IP addresses they are connected to.
If you use a web wallet or software that connects to a web wallet then your IP address is not gathered by other peers on the network. Only the web wallet has your IP address.
If you connect using Bitcoin-QT the other peers only know that you are broadcasting a transaction, they will not know if it originated from you or someone else. There are no IP addresses in the Blockchain.
The confusion comes from the web site Blockchain.info. They list a “Relayed by IP” address but that is just the first IP address they saw broadcast the transaction, not necessarily who originated the transaction. It is easy to configure Bitcoin-QT to connect to peers that do not publish IP address information.
To see the details of how it works see http://cointext.com/bitcoin-and-ip-address-privacy/