The phrase can be metaphorical, not referring to an actual person but a problematic factor in any situation. Traffic congestion was the villain of the piece in my morning commute.
Pro Tip 2/3
Not Literal
Doesn't have to be a 'villain' in the traditional sense, like in movies or books. In our project failure, the villain of the piece was poor communication.
Pro Tip 3/3
Collocation Clues
Words like 'become', 'reveal', 'identify' help to show the function and discovery of the 'villain' in context. After the investigation, we could finally identify the villain of the piece: a faulty wire.