At the beginning of the story, Huck regards Jim as he would any black in his home community, which is to say as he would think of any slave. He knew Jim better than other slaves since he had frequent contact with Jim through living with Miss Watson, Jim's owner, but he still thought of Jim as being physically big and strong, very superstitious, but capable of interpreting signs that could provide useful information.
Miss Watson's nigger, Jim, had a hair-ball as big as your fist...and he used to do magic with it. He said there was a spirit inside of it, and it knowed everything. So I went to him that night and told him pap was here again...What I wanted to know, was, what he was going to do, and was he going to stay?...the hair-ball talked to Jim, and Jim told it to me.
When Huck first discovers Jim on the island, he is pleased for the company. They hunt and fish and watch and the weather and explore the house being washed down the river. However, Huck's prank with the rattlesnake backfires and makes him realize how much he values Jim's friendship.
I slid out quiet and throwed the snakes clear away amongst the bushes; for I warn't going to let Jim find out it was all my fault, not if I could help it.
By Chapter 15, Jim and Huck are headed south, aiming for Cairo and the Ohio River into the free territory. Huck is forced to face the fact that Jim is a friend and a good person with feelings that can be hurt when Huck and Jim are separated in the fog and then reunited. Huck tries to convince Jim that he hadn't been away and that Jim had been dreaming, but Jim eventually comes to understand what Huck was doing.
Jim looked at the trash, and then looked at me, and back at the trash again...Then he got up slow, and walked to the wigwam, and went in there, without saying anything...It was fifteeen minutes before I could work myself up to go and humble myself to a nigger-but I done it, and I warn't ever sorry for it afterwards, neither. I didn't do him no more mean tricks
Huck proves his loyalty to Jim in the next chapter, saving him from the slave-hunters on the skiff by telling them the raft's only passenger was his pap, ill with small-pox.