I meant like this kind of compressor https://www.bauer-kompressoren.de/fileadmin/_processed_/csm_compressor-block-junior2_b92a76a02e.jpg also would the compressor reach high pressure if the diameter of all the piston have same sizes
There is a simple reason and a useful added benefit.
- As you compress air of a fixed mass it occupies less volume. If you give it more space again, it will immediatly decompress and the multiple stages become useless. If you give it just enough space to occupy at its current pressure, the air will compress further. You could reduce space by reducing the piston height but this will make it harder if not impossible to use only one motor for all stages and it will result in less compression per stage. You reduce diameter and leave height the same.
- A higher pressure with the same diameter will result in a higher force. By decreasing the diameter the exerted force is limited somewhat. Note that this is much less important as it is only possible through the need of #1.
By using different diameters you can drive everything with one motor and have to exert less work. You can further reduce the needed work by cooling down the gas between stages. The compressor in your picture does this also; there are coils between the pistons that will release some heat to the outside. This effect could be improved by cooling the coils or possibly submerging the whole compressor for underwater use.
Also take a look at these articles on the subject: