This is not the same meaning of the word staff as the common meaning where “the staff” is all the employees of a company. In “staff engineer”, staff is an adjective which conveys a level of seniority. From what I've seen, a “staff engineer” is more senior than a “senior engineer”, but less than a “principal engineer”. There is no “official” definition and the usage can vary between companies.
The general idea about these seniority levels is how much influence the person has: junior engineers generally do what they're told; senior engineers influence the other people on their team and neighboring teams; staff engineers have some influence on other people inside and outside of their company and have a significant impact on the design of the product; principal engineers have significant influence outside their own team and usually have been the main influence behind a new product.
The meaning is loosely related to “the officers chiefly responsible for the internal operations of an institution or business” and “the personnel who assist a director in carrying out an assigned task” (meanings 5a and 5d in Merriam-Webster), which derives from military usage (M-W 5b), but not exactly the same. A staff engineer is not necessarily particularly responsible for internal operations and the role is not particularly about assisting directors.
The meaning of “staff engineer” seems to be mysterious enough that a number of people spend some energy in attempting to define it, for example:
Note that the usage is different in different professions. For example, a “senior nurse” is short for “senior staff nurse” and is above “staff nurse”. The usage ultimately comes from military practice, where a staff officer is an officer who assists high-ranking officers directly, but the nuance conveyed by the word staff has evolved.
See https://english.stackexchange.com/questions/563389/usage-of-staff-as-a-seniority-level-staff-engineer about how widespread this usage is.