In an extremely backwards sense, America going into a senseless war that they thought they'd have in the bag, then losing, is sort of a deterrent.
It's a perfect display of what would or could happen if China lets its hubris get to it and invades Taiwan.
I could liken it to watching someone you know getting blackout drunk and needing their stomach pumped at the hospital, keeping you away from the booze.