Only on Saturdays and Wednesdays. Only between 12 p.m. and 4 p.m. Always with oranges and bay leaves.

Which is to say, there is a certain rigidity to how Brazilians enjoy their national dish, feijoada, an intensely savory meat and bean stew suffused with as many rules as ingredients, the meats alone sometimes numbering a dozen or more.

But dig a little deeper and you learn this dish—with roots set deeply in the country’s slaveholding past—actually was born to be ambitiously versatile, to make the most of whatever was on hand, and to be delicious no matter the combination.

My appreciation for this culinary dichotomy begins at A Figueira Rubaiyat, a sprawling São Paolo restaurant built under and around the massive figueira tree from which it takes its name. Leathery dinosaur limbs, the tree’s thick arms stretch prehistorically across the restaurant, punching through holes in the walls and glass ceiling.

It’s Saturday, and chef Francisco Gameleira sits beneath one of these limbs—some so heavy they are supported by metal girders—as his restaurant braces for the 600 diners who will descend today for feijoada. Here, it is served buffet-style: black beans, a dozen meats, white and brown rice, toasted cassava flour, and collards cooked with bacon.

Well-dressed diners and their children—each gets a balloon for the occasion—line up to assemble their feijoada as they see fit. Rice then beans always are the base, then meats are piled on or around, then the greens, finally the yuca—called farofa—sprinkled liberally over. Additional grilled meats are eaten alongside, because why not?

But feijoada’s origins aren’t nearly so formal. The dish, Gameleira explains, was slave food, hearty sustenance made from the bits of meat—mostly pork, the ears, tails, feet and tongue—that slaveowners rejected. Stewed low and slow with black beans, the result was a robust meal jammed with richness balanced by bright, tangy orange wedges to squeeze over it all.

Around the time slavery was abolished in 1888, feijoada jumped to the mainstream. Better cuts of meat—including beef—were added and variations proliferated. It quickly became Brazil’s national dish, though consumed only as lunch and only twice a week. Explanations for that are murky; some say it’s the Portuguese influence of ascribing meals to certain days.

As I ate my way across São Paolo, I learned that for all the rules around feijoada, there also are as many ways. At finer restaurants like A Figueira Rubaiyat, the meats—so many meats—typically are cooked with the beans, then separated and plated individually to allow diners to assemble as they like.

Home cooks eschew this formality, favoring a one-pot affair built from black beans and a handful of common cuts cooked until meltingly tender. We loved this simplicity and married it with several tricks Gameleira taught us, including starting with a bay leaf-rich soffritto-­like base and deglazing that with splashes of orange juice and cachaça, a Brazilian spirit.

A final lesson we learned at Agua Para o Vinho, one of the city’s many cafeteria-style eateries where workers enjoy feijoada as a sustaining lunch during a long day. There, it is topped with what owner Evaristo Jardim Silva called a “vinagrete,” a salsa-like mixture of chopped tomatoes, onions and herbs that added balancing brightness to the meaty stew.

The result? Delicious, no matter what day of the week you enjoy it.