Boyle's law states that pressure and volume have an inverse relationship if number of moles and temperature are kept constant.
In other words, when the number of moles of a gas, i.e. the number of particles of a gas, and the temperature of that gas are constant, and increase in volume will produce a decrease in pressure and a decrease in volume will produce an increase in pressure.
Here's why that happens. If you have a certain number of particles of gas in a container, the temperature of the gas corresponds to the average kinetic energy of those particles.
These particles move randomly in the container, colliding with each other and with the walls. The pressure a gas exercits is actually correlated with the force with which these particles hit the walls of the container.
Now, if you don't allow the average kinetic energy of the particles to increase or decrease, i.e. you keep temperature constant, when you increase the volume of the container pressure will decrease.
The same amount of particles now have a lot more room to move in; as a consequence, the rate of the collisions between themselves and with the walls of the container will decrease