This fusion of ideologies in the newly formed Republican Party was, ironically, primarily driven by a Democratic-supported effort. Namely, the Kansas-Nebraska Act of 1854, a piece of legislation that allowed slavery to expand into western territories. After it passed, a period of violent anti- and pro- slavery confrontations arose known as Bleeding Kansas — an antecedent to the Civil War.
The debate over slavery intensified over the next several years as a young Abraham Lincoln was beginning to get his political footing. Lincoln vehemently opposed the Kansas-Nebraska Act and would steadily bring his anti-slavery rhetoric into his political speeches in ensuing years. By 1860, Lincoln won the Republican Party's presidential nomination and soon the presidency. Then in 1861, seven states declared secession, with four more states joining the Confederacy several months later. You know the rest. The Civil War ended in 1865 when Confederate generals surrendered.
But back to the GOP. A few years earlier in 1859, Kentucky's Democratic Governor Beriah Magoffin — a staunch neutralist during the Civil War — harkened back to his party's Democratic-Republic Party origins in his inaugural address by saying, "The Grand Old Party has never changed its name, its purposes or its principles, nor has it ever broken its pledges."
And in 1858, a Democratic newspaper in New Haven, Connecticut, also alluded to the Grand Old Party in reference to Democrats, publishing the phrase "this Grand Old Party is divided and in danger of defeat."
But by the 1870s, the moniker had become solidified to the Republican Party. Politicians and newspapers began referring to the Republican Party as the Grand Old Party and the gallant old party — a salute to its role in preserving the Union during the Civil War.