When you're "looking at something online" you are downloading it. You may not always realize it but that data needs to get on your device, if only temporarily, for the browser or app to process it. On iOS devices this happens invisibly. With the Mac you have more options. Pages will let you do more with a .doc than iOS Safari will. If you have Word installed you can do even more. The Mac assumes that you might want to do more with the file than just look at it so it downloads it for you. It assumes this because you're using a full on computer. If all you wanted to do was look at the file it (Apple) assumes you would probably just use your phone. If you don't want to keep the file just put it in the trash. That's what your iPhone does, it just does it without you realizing it.