I know how you feel, Stickboy. I've gotten bitter over the exact same thing over the years...
Apparently it is really, really, really, really, really, really hard for bosses to admit that one guy does better and knows more than the next guy or himself. And if they both do something that can outwardly be maintained to appear similar, I think many a boss would die before he admitted it... And they will certainly fire you before that happens.
One guy will read the code, study, come here to this site , take courses in electronics, computers, CAD, spend time and money ... whatever... the next guy doesn't do those things.
On the job... Everyone knows when the two are on the job, who'll be making the decisions, doing the planning and ordering, and programming anything that comes up. Everyone knows who to ask rather than bothering to look it up. Everyone knows who'll be on the phone to the manufacturer, or reading the manual when anything requiring techincal understanding arises....
Everybody knows it, but nobody'll accomodate it in any meaningful way.
The boss will "delegate" dealing with this stuff to you. ( as, of course, is the right of the boss who has the authority to maintain the outward appearance of directing the work force... It wouldn't, of course, have anything to do with his inability.)
After a while, somehow it becomes your routine job to perform work at a higher level... for the same pay,... and as always, if you don't like it, you could walk away from everything you've done over the years and start over somewhere else.
Exactly how that is fair or reasonable, I have no idea. But, I will tell you this: I believe if you try to push for fairness, you will lose.