carb and toilet bowls work the same way... the raising float stops the inflow of water...or fuel in a carb
when either one does not work you have overflow :)
take the carb apart , inspect & fix the mechanical issue stopping the inlet needle from doing it's job of shutting the inflow of...