Engine oil is stored in either a wet sump (bottom of engine) or dry sump (separate holding area away from engine). These sensors monitor and report the oil level. Don't count on these sensors for the life of your engine; make a habit of checking the level manually every third fill up.
Have you ever gone to wash your windows and the blades just streak the dirt around because you are out of fluid? If the dash light is not indicating you are out of fluid you probably have a bad sensor or gauge.