Normally, wastewater will flow from the pipes in your home and to the main sewer pipe in the street. The flapper opens to allow the wastewater to flow.
If the main sewer pipe is full and starts to rise— which can happen in the event of a major blockage — the flapper closes to allow prevent water from flowing up and into your basement.
When the backwater valve closes the sewer line, you should NOT use the toilet, sink, shower, washer, or dishwasher. Until the flap is reopened, the wastewater will have nowhere to go except up the floor drain and into your basement.