It is one of the most basic sensors incorporated in modern smart devices. With any inertial motion in 3 axes, the tiny polysilicon semiconductors slightly bend to give different capacitance, from which the acceleration of the device is determined.
Similar to a traditional search coil used in physics laboratory, the magnetometer encompasses tiny "search coils" in 3 axes within which current would be induced when perpendicular magnetic field passes through it. The device converts the readings into magnetic field strength.
The working principle of gyroscope is similar to that of accelerometer except that gyroscope detects rotational motion rather than translational motion.
The light sensor relies on the famous photoelectric effect from Albert Einstein where photocurrent is generated across photocell upon receiving light. The photocurrent is then converted into corresponding light intensity.
Every smart device, especially smartphone, is equipped with a microphone that is usually made of sensitive conductor vibrating in different amplitude upon sound pressure exerted on it. The louder the sound, the more vigorous is the vibration, and thus the sound level can be determined.
Even a single source of sound in daily life actually comprises multiple frequencies (pitches). Using the same essential component of a mobile device, the microphone, the processor is able to resolve the "ingredients" or "fingerprint" of that sound by a famous mathematical operation called Fourier Transformation.
The speaker built in modern mobile device is an extremely powerful tool that broadcasts high quality and complexity of sound from media such as music and videos. It is such an easy task to generate a desired pitch, simply by a mode of vibration consisting one uniform frequency.