The relationship between these four things is that the last three of them work to determine the first. In other words, a person’s job performance is determined largely by their ability and their motivation, with some “input” from situational constraints.
Of course, a person’s ability has a tremendous impact on their job performance. If a person is asked to do a job that they are simply not qualified to do, they will not be good at it. As an extreme case, imagine someone who does not know how to read above a 3rd grade level being assigned to teach literature in a high school. It simply would not be possible for the person to perform well.
However, motivation can have an impact (whether positive or negative) on job performance. All other things being equal, a person who is motivated to work will do better than one who is not. Strong motivation can make up for some amount of deficiency in abilities.
Finally, situational constraints can improve or harm a person’s job performance. One of the most important of these constraints is supervision. A person can have ability and motivation, but their job performance might be harmed if their supervisor does not know how to handle people. By contrast, a less skilled or motivated worker might have their performance improved by deft supervision.
Thus, ability, motivation, and situational constraints combine to determine job performance.