The particles in a gas move randomly at high speed. They are far apart, so they travel in straight lines until they hit something. In a sealed container they keep colliding with the walls.
Each collision exerts a tiny force on the wall, and the force acts at right angles to the wall. There are billions of collisions every second, so the tiny forces add up to a steady force. The pressure of the gas is this total force on the wall divided by the area of the wall.
The more often the particles collide with the wall, the higher the pressure. A harder collision gives a larger force and also a higher pressure. If the same gas is squeezed into a smaller volume at the same temperature, the particles keep the same speed but hit the walls more often, so the pressure increases.