How does v-for work in Vue.js?

v-for iterates over data arrays or objects, generating elements for each item. Example:

<ul>
  <li v-for="item in items" :key="item.id">{{ item.name }}</li>
</ul>