What is a trapped piece in xiangqi and how do I exploit one?
These answers restate the rules implemented by our open-source engine, which follows the WXF laws for movement, checkmate and both repetition rulings: a side that forces a repetition by perpetual check or perpetual chase loses rather than drawing. The chase half has not been validated against the official casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it before publishing.
Direct answer
A piece with no square it can move to safely. Horses on the edge of the board and chariots that have pushed deep into enemy territory without support are trapped most often, because both run out of squares faster than they expect. Once a piece is trapped, a second attacker usually wins it outright.
Where trapped pieces come from
An edge horse only reaches four points to begin with, so a couple of well-placed defenders can cover all of them. An overextended chariot runs into the same problem differently: it has plenty of squares in the abstract, but most of them walk into a second attacker.
Winning a trapped piece
Do not rush; a trapped piece is not going anywhere. Bring a second attacker to confirm every escape square is actually covered before committing further material, since a piece that only looks trapped can sometimes find one square you missed.
Related questions
Can advisors or elephants get trapped?
Rarely in the useful sense, since they have few squares to begin with and are not normally worth chasing.
How do I avoid trapping my own pieces?
Before an aggressive advance, count the squares the piece will have left once the opponent's obvious replies are played.