Media queries are HTLM and CSS W3C specifications that allow to detect media type (screen, print, TV, etc.) and different specifications for each media (window width, resolution, orientation, supported colors, etc.).
With media queries presentations can be tailored to a specific range of devices and to device characteristics without changing the content itself.
At first, media queries were used on the web for adapting content for printing. For instance when a print media type is detected, black is used as text color and navigation menus are supressed.
With current device fragmentation, media queries are mainly used for responsive web design and notably to adapt smartphones and tablets.
Media queries and responsive grids theoretically allow web designers to create websites and emails that flexibly adapts to all devices and configurations but some browsers, apps and devices may not support media queries.
Below on the right, an email optimized for mobiles when media queries are not supported (image credit Litmus blog):