Once upon a time, King Indradyumna from Orissan ordered Viswakarma (the demigods' architect) to build him deities of Lord Jagannatha, Baladeva and Subhadra depicting their pastimes. Viswakarma agreed but on one condition.  Nobody was to disturb him or see his work. 
A long time passed and the King began to doubt Viswakarma's credibility because he heard no noise coming

from the room in which he was supposed to be working.  So, one day, he entered the room to see what work was being done.  Just then, the architect disappeared leaving three unfinished deities. 

Although they were unfinished, the King decided to worship these deities and this is how Lord Jagannatha, Lord Baladeva and Subhadra came to be.

When Krishna left Vrindavana, the gopis felt great separation.  SO, when they heard that Krishna, who is also called Jagannatha (the lord of the universe), had come to Kurukshetra with his brother Baladeva and sister Subhadra, they came to meet him and tried to take him back to Vrindavana by pulling his chariot away. 

Ever since the Orissan king had the deities made, it has been a tradition to commemorate this pastime. 

Many centuries later, a Hare Krishna devotee came with a miniature replica of Jagannatha to his guru Srila Prab

hupada and asked him what it was.  Prabhupada began to tell him about the story of Jagannatha and asked a carpenter devotee to make large scale models of Jagannatha, Baladeva and Subhadra. 

When these models were completed, Prabhupada paraded on the streets of San Francisco with the deities.  This was the first North American Ratha Yatra.