If your query is a constituents query, it is giving you a list of members, not memberships.  This is why the query doesn't match the memberships.  There are things we can adjust in query to make these match up though.
  1. Only include 1 member per membership: In query, on the left, click Member.  In the middle, click Primary member and move to Include Records Where.  Set the criteria to equal to Yes.
  2. Exclude dropped members that used to be on a membership but no longer are: on the left, click Member.  In the middle, click is dropped and move to Include Records Where.  Set the criteria to equal to No.