You play teams within your own division 4 times, but if you played 4 games against every team in the conference that would mean 56 conference games since there are 14 other teams in the West. With 26 games left after that for an 82 game season, there wouldn't be enough to play each Eastern Conference team twice. So you only play 4 games against divisional foes.
I miss the good old days when the Rockets would play everyone in the Midwest Division 6 times. Added to some good rivalries with Utah, Denver, etc....
Actually, in addition to playing 4 games against divisional foes, you also play 4 games each against 6 of your in-conference, non-divisional foes. Then, it's 3 games each against the remaining 4 in-conference, non-divisional foes. Which teams you play 4 times and which teams you play 3 is randomly assigned.