the worst, which you may have, is that tree roots have grown into the drain line somewhere down toward the street [where the connection to the municipal sewer is]. what happens is they block the flow of "solids" but allow less than optimal amounts of liquids to pass through. You've detected this because the washing machine dumps five to seven gallons of water in all at once -- and that's more than the nearly blocked sewer line can pass quickly -- so it backs up -- including some of the "solids" that can't pass the roots.
A plumber and his power snake can clear this. He'll likely need to snake both the washing machine drain line [from the roof vent] and then find the cleanout access outside the house [although it might be in the basement] and snake downstream from there.
How far the snake goes in from the cleanout access until it hits the obstruction tells the plumber where the obstruction is. If his powered auger [snake] chews through it, you might be good for another year or three -- while the roots grow back. then it'll have to be done again. and again. until the roots break up the sewer line and the line has to be replaced.
You want to put off replacing the sewer line. That has to be done to current code -- which, in my brother's case got him a quote of about eighteen thousand dollars [$18,000] in a large suburb up north. Trenching would be required from the house to the municipal connection and an entirely new line laid and properly backfilled.
removing these roots/obstructions is your obligation if a) you own the property, and b) the obstruction is before the municipal sewer line [as it almost always is].
of course, if you are a tenant, this is the landlord's problem.