A transaction can carry with it an input
field. So, for example, I can send my friend 10 ether, and in the input
field, I can add a message that he can later read. Assuming my account is a regular account (as opposed to a smart contract account) and so is his nothing really gets stored on the blockchain other than the transaction (and its input
).
Alternatively, if my friend's account is a smart contract that has been programmed in such a way that the transaction causes it to do something and then store the results (say it adds me as a token holder) to its own internal state. That internal smart contract state has to be saved on-chain and has a fairly high cost per megabyte associated with it. In this case, many people store the actual data in a distributed files system such as IPFS (because it's way cheaper) and store only a pointer to the file (i.e. the IPFS hash) in the smart contract.
IPFS does not require a server because it is a distributed files system. Anyone who wishes to participate must run an IPFS node locally on their own machine. (Although, there are services that allow you to run a remote IPFS node, but that's not the preferred embodiment.)