This an idiom for when an actor is earnestly overacting. From TV Tropes:
A common term for a scene where an actor’s acting so damn hard that they’re picking bits of scenery out of their teeth for days. Sometimes scenes can actually require this, but more often the actor and/or director just has the character go over the top.
If you search DuckDuckGo for “chewing the scenery”, the Wikipedia page for “overacting” is one of the top results.
There are various claims to the source, from theater reviews in 1930 and back into the 1800s.