Why does gas pressure increase upon compression and decrease upon expansion?

If you change the volume of the gas in which it is located, but at the same time leave the concentration of molecules and temperature unchanged, then the pressure will undoubtedly change. With a decrease in the volume of gas, its pressure will increase, since the number of impacts on the walls of the vessel will increase. And if, on the contrary, increase the volume, then the pressure decreases accordingly.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.