They're both from the ribs of the cow but the ribeye is closer to the head which makes it more tender and well marbled. The T-bone, aka Porterhouse when it is closer to the middle of the cow, is a leaner cut that comes from the lower ribs, closer the hind of the cow.