No one knows its origin. Some speculate that it may have origins in Old Testament legislation about who gets repaid for a loss. “It depends on whose ox got gored.”
It simply means that we are often complacent about things because our interests (our ox) are not being affected. You see the idea being illustrated amply in government. Most people go along quietly living their lives as long as there is no upset. But if something changes such as taxes, benefits, perceived wrongs, and so forth, then “all hell breaks loose.” Marches, peaceful and violent, break forth. People call, fax, or email their congressional representatives. Demands are made or votes will be withheld.
The spirit of the Bible is that everybody’s ox is my ox. God was particularly unhappy with Israel because they were proceeding in the direction of “it wasn’t my ox, so I’m not going to do anything.” Which is why the prophets excoriated the nation for their lack of care. People went hungry, widows were neglected, immigrants were mistreated, and children went without care. So Amos wrote, “You drink wine by the bowlful and perfume yourselves with fragrant lotions. [But] you care nothing about the ruin of your nation.” Amos 6:6.
The cartoon in the most recent Christian Century seems pertinent. A dog tells a cat, “Who are you kidding? You’re all about small government until you get yourself stuck in a tree.” A compassionate nation should care about anytime anyone gets caught in a tree. When one’s person “ox gets gored” we all suffer.