difference between $wp_the_query and $wp_query? & getting the values properly [duplicate]

You should read in this answer it explains it in depth.

in short,

  • $wp_query is the variable that holds a copy of $wp_the_query global query that could/can be modified by plugins and themes
  • $wp_the_query is the variable that holds an unmodified copy of the global query object and used to reset the $wp_query object when we call wp_reset_query()

I think you now understand as to why it makes sense to have both available to us.