For a bit of fun, let's derive the equation to prove that the mass doesn't matter.
Let's imagine a glass cube with a single particle bouncing back and forth between two walls separated by a distance 'x'. Let's find the force of a [perfectly elastic] collision with a wall. Imagine the particle is traveling from the left wall to the right wall with velocity 'v', hits the wall, bounces back the exact same way it came, and travels back to its original point.
Force = ma
a = ∆v/∆t
Force = ∆mv/∆t
m∆v = Impulse (change in momentum) which we refer to as 'P'
Force = ∆P/∆t
What is the ∆P in this case? If the ball hits the wall with velocity v in a perfectly inelastic collision, it'll bounce back with velocity -v. m∆v = m(-v - v) = m*-2v = -2mv. If we had arbitrarily said the initial v was -v and the return was +v, this would just be +2mv. For simplicity's sake, let's just go with 2mv.
How much time did it take to complete one collision and return to the same spot? Well it had to travel 'x' there, and 'x' back, a total distance of 2x, and v = d/t so t = d/v. ∆t = 2x/v
Force = (2mv)/(2x/v)
Force = mv^2/x
Let's find pressure. Pressure = Force/Area. We already found force, and our particle is applying pressure on one side of our cube, so the area of the surface receiving the force is x^2.
Pressure = (mv^2/x) / (x^2)
Pressure of one particle going in the x direction = mv^2/x^3
x^3 is equal to the volume of our cube, so:
Pressure of our one particle between two sides of our cube is = mv^2/V
But what if instead of only talking about one particle going in the x direction, we wanted to talk about all the particles going in the x direction? We could say that we have N particles in the cube, and in our simple model (that actually holds up well under experimentation) they have 3 directions to go (x,y, or z), so really what we've described so far is the pressure generated by one-third of all the particles, which is N. So N/3
Pressure of all particles going in the x direction = P = (mv^2/V) * (n/3)
Let's rearrange a bit:
3PV = mv^2 * N
Let's divide both sides by 2 cuz why not
(3/2)PV = (mv^2)/2 * N
That italicized term is our kinetic energy! To be clear, it is the average kinetic energy for one molecule in our system. mv^2/2 * N is the kinetic energy for all the particles in the cube. This value (KE * N) is what we refer to as internal energy U.
And so the total kinetic energy U of the system is equal to (3/2)*PV. But wait! PV = nRT. So, (3/2)*PV = (3/2)*nRT.
Where n is the number of moles. We also know that R = Kb (boltzmann's constant) * avagadro's number (6.022E23 particles/mole). So U is also = (3/2)*NKbT
In conclusion, for an ideal gas:
U = KEavg * N
= (3/2)*PV
= (3/2)*nRT
= (3/2)*NKbT
Taking this a step further:
KEavg * N = (3/2) * KbT * N
Cancel out Ns:
Average Kinetic Energy = (3/2)KbT
And Kb is a constant. This proves that for an ideal gas, kinetic energy is really just dependent on temperature.
So you can see that as long as the number of particles and the temperature remains constant, the kinetic energy of the system (internal energy) remains constant.