The general, yet incorrect, use of “stem the tide” is to deflect a serious problem, but tides can’t be deflected.
A stem is the upright beam, at the fore of the ship where the hull timbers form the prow.
The nautical maneuver against a surging tide is the same as against an angry sea.
The ship is turned to stem the onslaught.
To “stem the tide” means that to overcome serious problems, you must face them head-on.