This song was written by the Nashville songwriters Dean Dillon, Wil Nance and Buddy Brock. Nance was the new guy: he idolized Dillon and was very excited to write with him. Before the session, he told his wife Holly that he needed a song idea, so she went on the internet and found some clichés, including one that read, "If wishes were horses, beggars would ride."
Nance didn't like that one, but it got him thinking: "If heartaches were horses I'd ride away." He told Brock that line, and Brock added, "And hard times were cattle." They took that to Dillon and completed the song. (Here's the Songfacts interview with Wil Nance