Economically, Britain in particular, was hurting for cotton imports due to the blockade of the South, and was forced to turn to other exporting countries such as Egypt and pay four times the prewar rate. This motivated some in the British government sympathetic to or invested in the British textile industry to lobby for intervention on the side of the South.
But as Europe had emancipated their slaves long prior to the war, there were moral motivations to oppose the South and slavery, with the English monarchy especially of this opinion. That being said, the British Empire could benefit from a divided America that was increasingly threatening to their own world power status.
Technology and other military considerations played a role as well in their final decision to stay out of the war. Most European countries with any maritime presence watched in horror as war technology, most notably iron ships, which made their wooden navies immediately obsolete. In addition, the sheer size and might of both the Union and Confederate armies once the war got going, then the largest and second largest in the world, respectively, made Britiain acutely aware of what consequences awaited the country that backed the losing side.
By 1862, Gettysburg had not yet been lost, and some of these developments were still in progress, but the basic factors influencing those against intervention were slavery, the North's military strength, the belief that the South had little chance to win, and the insatiable British demand for cotton.
In the end, the British decided to stay out of the war almost entirely.