In a gas there is no force between particles. Particles are unbound and are free to move. The only forces present are the collision forces with the walls of the container. Which are dependent on the number of collisions ( amount of gas) and the momentum of each collision ( dependent on the temperature of the gas) As the molecules are free to move the random probability makes the pressure close to uniform through the whole mass of the gas.
In a solid each molecule is connected to each other molecule by bonds.
The only way to compress the substance is to bend the bonds. This is similar to compressing or bending a spring and energy is provided to those "springs"
They do not need to be compressed a large distance to cause a big increase in force.
The compression of one part only causes distortion to the bonds near the point of compression so the forces and pressure elsewhere in the solid are small but the forces and pressures NEAR to the point of compression must be very high.
In a liquid, the molecules are almost as close as in a solid. They are not bonded to each other, but they cannot be forced closer due to the electrical repulsion between molecules.
So if the liquid is compressed a small amount some of the molecules must be made closer than their "natural" distance and the result is energy stored in the electric fields. Very similar to the situation with the solid. Except as the molecules are free to move if you create a force at one point the molecules will move away from that force.
They continue to move until the force between molecules is close to the same throughout the whole bulk. So the pressure is uniform throughout the liquid.