Consider the following characters, 牛 and 生. I know both are not exactly identical for sure.
According to the textbook I am using, the stroke orders are given as follows:
My question is why the third and fourth steps are different?
If you compare these two links:
you can see how these characters have evolved over time.
Basically, 牛 starts as the image of the face of a water cow with its horns. so the down stroke came last. Conversely, the life image emerged from 屮 and 土 at one point during its evolution so you write the parts that come from the top half first which means you wind up doing the down stroke as stroke 3 and then two horizontal strokes after that.
Sometimes these historical artifacts of how to write it are better preserved in Japanese than Chinese (esp. compared to mainland China).
There are many such exceptions. A nice example occurs already with the first-grade kanjis for "left" and "right".
Here it makes some sense, because you write the first two strokes of "left" from the right to the left, while you write the first two strokes of "right" from left to right, even though they look exactly the same. See also http://www.sljfaq.org/afaq/stroke-order.html for further examples. I don't know if it is possible (or helpful) to find an explanation for each exception. Btw, does somebody know which authority determines the "correct" stroke order?
I can only speculate, but Japanese (and Chinese which it is copied from) was traditionally written from top to bottom, so many characters are "optimized" for writing in this direction. Both
_ are fine to end a character in the bottom, so the next one can be started without too much moving. That explains why character in left column is ended with
As for the character in the right, it feels smoother (try it with hand, imagine to have a brush in it) to write it as presented - you do not need to go up too much (if it was written as the left one, you would need to get up longer after the middle
But it is just a sort of 'reverse engineering' from the fact of the top-down writing direction. Maybe kanji stroke order has some more complicated and more formalized rules.