The <defs> element is used to store graphical objects that will be used at a later time. Objects created inside a <defs> element are not rendered directly. To display them you have to reference them (with a <use> element for example).
Graphical objects can be referenced from anywhere, however, defining these objects inside of a <defs> element promotes understandability of the SVG content and is beneficial to the overall accessibility of the document.
Example
<svgviewBox="0 0 10 10"xmlns="http://www.w3.org/2000/svg"><!-- Some graphical objects to use --><defs><circleid="myCircle"cx="0"cy="0"r="5"/><linearGradientid="myGradient"gradientTransform="rotate(90)"><stopoffset="20%"stop-color="gold"/><stopoffset="90%"stop-color="red"/></linearGradient></defs><!-- using my graphical objects --><usex="5"y="5"href="#myCircle"fill="url('#myGradient')"/></svg>