The speed of a wave is determined by the properties of the medium.
If the wave is a mechanical wave, then its speed is determined by the physical/mechanical properties of the medium ... the density, viscosity, etc.
If the wave is an electromagnetic wave, then its speed is determined by the electrical properties of the medium ... the electrostatic permittivity, magnetic permeability, etc.