Einstein's statement that velocity (speed) and energy are constant for all inertial frames of reference is based on his theory of special relativity. In special relativity, Einstein proposed that the laws of physics should be the same for all observers in inertial frames of reference, which are frames of reference that are not accelerating.
However, it's important to clarify that the term "constant" here refers to certain fundamental properties that remain invariant, rather than a fixed value that doesn't change. In special relativity, the concept of constancy refers to the principles of relativity and the speed of light in a vacuum being constant for all observers in inertial frames of reference.
According to the principle of relativity, the laws of physics should appear the same for observers in different inertial frames of reference. This means that the fundamental principles governing physical phenomena, such as the conservation of energy, should hold true regardless of the observer's velocity or motion.
In the case of the constancy of the speed of light, Einstein's theory of special relativity states that the speed of light in a vacuum is always observed to be the same value (approximately 299,792,458 meters per second) for all observers, regardless of their relative motion. This implies that the velocity of an object, as measured by different observers in different inertial frames of reference, must be adjusted to account for the effects of time dilation and length contraction predicted by special relativity.
So, when Einstein refers to the constancy of velocity and energy in special relativity, he is referring to the principles that hold true for all observers in inertial frames of reference, taking into account the effects of time dilation and length contraction as required by the theory.