Detailed answer
Both are generic containers.
Div groups flow content, while span wraps phrasing content such as words in a sentence. Their default display behavior differs, but CSS can change it. Prefer a more specific semantic element when the content has a clear purpose that another element can express.
Example
<div class="card"><p>Learn <span class="highlight">HTML</span> today.</p></div>
Understanding the behavior
Div and span are generic containers with different default layout behavior. Their lack of additional semantics can be useful for styling wrappers, but they do not replace controls, headings or lists. CSS can change display without changing the underlying meaning.
Practical implementation notes
Use a span for a small inline text fragment and a div for a larger generic group when no specific element fits. Start with the correct semantic element whenever one describes the purpose.
How to check it
Keep the word in span and the card in div, then inspect nesting in the DOM.
Expected result
The paragraph remains a valid phrasing-content structure.
Watch out: Do not wrap arbitrary page sections in a span.
Read the reference ↗