A junior officer was a commissioned officer, typically with the rank of no greater than lieutenant. The term was often used to refer to the early part of an officer's career when he or she had little or no command experience or department head responsibility.
Nonetheless, exceptions to this existed: an officer with the rank of lieutenant or lower was not considered a junior officer but rather a staff officer – if he or she served as a department head or other supervisory position in a particular command's senior staff. An example of this was Ensign Harry Kim, who, despite his low nominal rank, served as the Chief Operations Officer, the Operations Division department head, and part of the senior staff aboard the USS Voyager. As department head, officers who would otherwise outrank him instead served under him. The same was true for (provisional) Lieutenant Junior Grade and Chief Engineering Officer B'Elanna Torres. (Star Trek: Voyager). A junior officer was sometimes considered –?colloquially – part of a vessel's "junior staff".
One illustration of the gap between senior and junior officers occurred when, on behalf of Voyager's junior staff, Ensign Jenkins thanked Harry for diffusing the situation with the Series 5 long-range tactical armor unit that threatened the crew – even though they both held the same nominal rank of ensign. (VOY: "Warhead")