How can a player hit a home run with a broken bat? Although they're rare, I've seen a few instances where a baseball player breaks their bat and still manages to hit a home run.  Two examples:


*

*Chris Davis from the Orioles did it in 2012 (https://www.youtube.com/watch?v=mJ18aGmKnc4)

*Bryce Harper from the Nationals did it in 2018 (https://bleacherreport.com/articles/2770901-bryce-harper-launches-406-foot-broken-bat-home-run-during-nationals-vs-mets)


I feel sure there are other instances, but this will give the idea.
Broken bats are not especially rare, but usually any hit resulting from a broken bat is weak.  When the bat shatters or the head breaks completely from the handle it is not unusual that the fragments of the bat may go farther than the ball.  When the bat cracks but does not fully break, it's not unusual for the ball to make it to the outfield, but these hit usually do not carry as far as if the bat stays intact.
In the two examples above, however, the bats snap completely, leaving the player with about 8-12 inches of handle in their hand and the ball carries over the wall, so let's say greater than 375 feet.  The Harper home run was estimated at 406 feet.
The physics of these broken-bat home runs is not obvious to me.  Once broken, the player cannot provide torque on the head of the bat, so they should have much less ability to change the momentum of the ball, and some energy must go into breaking the bat.  I saw the Chris Davis home run above when it happened on television, and in the slow-motion replay, as I recall it, it also wasn't clear when in the swing the bat broke.  I got the impression that it might have broken after contact with the ball was complete. (The announcer says the bat head ended up "in the Oriole's dugout," which is a clue to where it became disconnected from the bat.  The dugout is more or less behind the left-handed hitting Davis in foul territory, and the ball cleared the wall in fair territory.  Likewise, the announcer on the Harper home run says the bat head "hit the screen," which suggests that it flew reasonably far into foul territory while the ball cleared the wall fair.)  
Is there some vibrational mode or other failure mode in the bat that would allow it to break in the follow-through?  Could it be that the bat head already has sufficient momentum to redirect the ball, so the loss of connection to the hand doesn't matter? I think the former is more likely, but I'm not sure how that would manifest in the bat.
 A: Nobody is going to break a bat just by swinging through the air. It breaks after the ball is hit. 
If the weakest part of the bat is some distance away from the hitting point, it will break when the stress wave from the impact reaches the weak point. In fact, it might not break until the stress waves (two, one starting in each direction from the impact point) have traveled up and down the bat more than once.
The stress waves do not travel instantaneously along the bat. They move at the speed of sound in the material, which is typically about 4000 m/s in wood, compared with 340 m/s in air. Since that bat is about 1.1m long, and the ball speed leaving the bat from a fastball is typically about 50m/s, the ball has already travelled about 13mm (half an inch) away from the bat before the whole length of the bat has "felt" the shock of the impact.
For a simple model of the bat as a uniform cylinder, if the impact point of the ball is a distance $d$ from one end of the bat, the two stress waves will be superimposed again at distance $d$ from the other end, as they travel along the bat. The bat may break at that point, not where the ball was hit. Obviously this is an over-simplified model of a real bat, but it describes qualitatively what can happen - the two stress waves must meet again at some point, as they move along the bat in opposite directions and are reflected from the ends.
The bat may not break the first time the stress wave passes a weak point. it may take several passes to cause enough damage for the bat to fail.
To summarize all this: at the time when the bat breaks, the ball is already in flight.
A: I've revisited this a few times since posting the original question.  A few empirical points that I've picked up over time:

*

*There are some nice videos of hits that have been slowed down frame-by-frame and do show waves traveling through the bat multiple times.  This is in line with parts of the answer by alephzero, including as expanded in the comments.  The potential exists for the bat to break on a second or third pass of the wave through a weak point, which could be after the ball has left the bat.

*There is conflicting information about whether or not the initial sound wave would reach the end of the bat while the ball is still in contact with the bat given the finite speed of sound in the wood. It is certainly possible in some cases that the initial wave does not reach the handle end of the bat before the ball leaves, but the difference in time appears to me to be on the same order in variations in the speed of sound for different woods, length of the bat (which goes to the distance the wave has to travel), and the amount of time that the ball is in contact with the bat.  For the last one, it's important to note that the ball also deforms significantly on contact.

*Most convincing for me was that there was a home run hit a few years ago where the batter was not holding the bat at all.  He let go of it early and still hit a home run.

So for the home runs, it seems to me that the single most important factor is that the head of the bat already has significant momentum and energy at the time of contact such that it's not clear that what happens to the bat matters at all, especially when the ball hits the barrel of the bat.
On the other side of this question was why so many broken bats result in weak hits if the bat breaking does not matter on the home runs.  In retrospect it seems this was a correlation vs. causation issue.  Pitches that hit weaker parts of the bat, like near the handle instead of near the barrel, are more likely to break the bat and more likely to result in a weak hit regardless of the bat breaking.  The energy that goes into breaking the bat may also be a more significant fraction of what would otherwise have gone to kinetic energy of the ball had the bat not broken for the same reason.
