A file made of instructions, not pixels
Open an SVG in a text editor and you will find readable XML: a circle at these coordinates with that radius, a path following this sequence of curves, filled with this colour. Nothing in the file specifies a resolution. The renderer works out the pixels fresh every time it draws, which is why the same file is crisp on a phone, on a 5K monitor, and on a billboard.
It also means the file size depends on the complexity of the drawing rather than on its dimensions. A simple icon is a few hundred bytes whether it is displayed at 16 pixels or 1600. A detailed map traced from a photograph, by contrast, can run to megabytes of path data and render more slowly than an equivalent PNG.
Editable in ways raster images are not
Because the file describes shapes, you can restyle it after the fact. Change a fill colour with one text edit, or leave the colour unspecified and let CSS set it — this is how icon systems make a single icon file adapt to light and dark themes without shipping two copies.
It also means SVG carries whatever the exporter put in it. Design tools routinely leave behind editor metadata, hidden layers, and enormous numbers of decimal places in coordinates. Running an SVG through an optimiser before shipping it often cuts the size by half without changing a pixel of the output.
SVG is code, so treat it like code
An SVG can contain <script> elements and event handlers. When it is displayed as an image — inside an <img> tag or as a CSS background — browsers refuse to run that script, so it is inert. When it is inlined directly into a page's markup, the script becomes part of that page.
The practical rule: never inline an SVG you did not create or sanitise, particularly one uploaded by a user. This is a genuine and regularly exploited attack path, and it is the one meaningful downside of a format that is otherwise entirely benign.
Converting SVG files
Converting SVG to PNG rasterises it at a size you choose, which is what you want for email signatures, social media, print shops, and any software that cannot read vectors. Pick the target dimensions deliberately — the whole point of the conversion is that you are freezing the resolution, so export at the largest size you will need.
Converting the other way, from PNG or JPG to SVG, is not really the same operation. It requires tracing, which approximates the image with paths. That works well for a black-and-white logo and badly for a photograph, where the result is usually a huge file that looks like a poor watercolour of the original.