While this question might seem pretty simple at first, especially if you've already looked at it in school or such, however, as you dive deeper to into the fundamentals of it, things can get a bit complicated.
Since pressure plays such an important role in the universe, I very often quote pressure of some kind in my articles, so I figured it would be good to create a place that people can back to, to remind themselves of what pressure actually is, how it works, and why it even exists.
Therefore, without any further or do, let's first discuss what pressure is exactly.
The primary reason why pressure can be a complicated subject is that pressure for liquids and gases arises from different mechanisms than in solids.
In addition, pressure can arise differently for non-static and static fluid!
Static means still, and an example of a static-fluid would be a bath of water.
A non-static fluid or often referred to as a dynamic fluid, on the other hand, involves movement, and an example of a non-static fluid would be water in a river.
Firstly, let's look at solids.
On Earth, pressure at a particular point in a solid arises solely due to the weight of matter that's above that particular point.
Note that weight is different to mass, in that weight considers acceleration due to gravity. The mass of an object doesn't change with acceleration (ignoring any relativistic effects of travelling at a velocity), but the weight of an object will change depending on the acceleration that it feels due to gravity.
Hopefully that's fairly straightforward.
The particles themselves that make up solids do not have any form of transpositional velocity, meaning that they don't move around anywhere, rather they simply vibrate or oscillate back and fourth.
With no movement of particles, no pressure arises from collisions between particles and the edge of the container.
The phrase "edge of the container" seems confusing at first, but know that it just refers to particles colliding with the sides of whatever they're being contained in.
For example, molecules of water inside of a glass would collide with the sides of the glass that would result in an increase in pressure.
Since particles in a solid don't move, no pressure would arise from such activities.
That's the main difference between pressure in solids, and pressure in liquids and gases, and it's an important one because it's responsible for some of their characteristics.
To go into more detail of this, we can say the following:
Solids only experience pressure due to their own weight (plus the weight of any matter that's bearing down on the solid) and hence they only experience pressure in the line of their weight vector.
Remember, weight is mass under acceleration, and since acceleration is a vector quantity (because it's a change in velocity over time), meaning that it has direction, weight is also a vector.
Everything on Earth has weight because its mass is being accelerated towards the Earth's centre of mass, with "towards" being the operative word here.
It's important to remember that weight has direction associated with it (which is why we call it a vector quantity, as opposed to a scalar quantity like mass or speed), where as mass has no direction, and is not variable due to gravity - your mass remains the same, regardless of where you are.
Because solids do not experience pressure perpendicular to their weight vector (which can generally be thought of as their "sides"), they do not fill the shape of their container.
For example, and I'm sure you're all very aware of this but it's good to clear things up, if you place a solid in a plastic cup, the solid won't change its shape to fill that cup, where as liquids (such as water) and gases will.
Obviously, the viscosity of the liquid will affect how well it can do this (take honey for example), but it ultimately will try to.
Liquids and gases
In contrast to solids, both liquids and gases are comprised of particles that do have transpositional velocities, and hence they will move around.
As liquids, particles will wobble and flow in groups, where as gas particles will individually fly around their container at high speeds.
The reason why particles behave differently for each sate of matter is a bit off topic for this article, but you can read all about that here - it's not that complicated at all!
The reason why this is related to pressure is because particles colliding with the edges of their container will do so with x amount of force.
If we think back to Isaac Newton's 3rd law of motion, however, we know that for each force there is an equal and opposite force, hence the container pushes back at the gases that collide with it.
This "pushing back" induces additional pressure on the substance, so it must be accounted for when we try to apply these concepts to real-life scenarios and actually attempt to quantitively work out the amount of pressure that a substance is under.
Therefore, we can say that not only do liquids and gases feel pressure due to their own weight (plus any additional weight from matter bearing down on them), but they also experience pressure due to collisions of their particles with the edge of the container that they reside in.
This is the key difference between pressure involving liquids and gases, and pressure involving solids.
Pressure plays a huge role in the universe, and not just with massive celestial objects like planets and stars, but it in our own bodies and in the water-systems that we rely on for various things.
Think about a hose-pipe for example...
We all know that water gushes out of a hosepipe as opposed to just dripping out, but what happens if you decrease the gap that the water has to get through with your thumb?
Well, you probably know that the water goes quite some distance, and that's all to do with pressure.
As the water is running though the pipe, the water molecules collide with the edge of the container (remember from before), with the "container" here being the hose-pipe.
As they do so, the pipe pushes back at the water, obeying Isaac Newton's 3rd law of motion (as we talked about earlier).
This force gives the water acceleration, obeying Isaac Newton's 2nd of motion, force = mass*acceleration.
Isaac Newton played a huge role in developing our understanding of the universe, and you'll definitely see his name here a lot at Expansive.
If you then decrease the gap that the water has to get through, all the water will try to get through it at once, which increases the pressure at that point once again.
Hence, the water that get's through will feel an increase in acceleration as it bursts through the gap.
There are so many other applications of pressure, but I think that suffices for a fundamental understanding, and only I want this article to be a brief one that doesn't go too far in terms of the different formulae - this is more of a conceptual explanation.
So come back to this one as many times as you need as like I said before, it's really beneficial if you can understand pressure properly as it's applicable in pretty much every area of astronomy/physics.
Thanks for reading!