There are several reasons why coins have generally (at least to my knowledge, although a historian I am no numismatologist..numismatician...numistorian?) been flat, not least ease of size and transportation. The reason many coins in history have been round is simply a by product of the process of stamping the images of the coin. The force used to imprint the image on the coin naturally leads to a circular-type shape - picture pressing a mark into warm wax, the blob is forced under pressure of the die and, as the die is pressed equally, the wax excess spills out either side - similar with the stamping of coins - roughly round coins meant less work cleaning up the edges after stamping.
Another reason for the flat nature of most coins, be they round or square, is that the cutting of the ingots in preparation for sheets, is much easier and simpler to do in mass numbers if the ingots are relatively flat, and have several stacked one on top of the other. This allowed you to cut the coin shapes out in multiple quantities at a time. Remember this is all in a pre-industrial time so flat, and round, often saved time and work in producing coins - you never wanted the cost of individual coins production to be greater than the value of the coin itself, if you could help it.
Flat coins are also MUCH easier to stack in volume - which is in itself an obvious benefit, but more importantly coins were weighed and measured against known weights to adjudicate the coin's metal value - on a set of scales it is much easier to stack in numbers of flat coins against your weights than spherical or pyramid shapes.
This all explains how early and even medieval coins were flat and often round. However, in advent of milling in the 16th century (those fine lines down the edges of your coins) meant that coins could be produced and their milled edges prevented the ease and use of 'clipping' (trimming the edge of a coin for its metal value - do it to enough coins and you get enough metal to make more coins). It was more effective to mill a round coin - as casual forgers and clippers found it increasingly difficult to hide evidence of their work - increased public perception of the trust in the coinage and therefore their willingness to use it.