How to check an entry is in a section within a for loop
Check against entry.section.handle:
{% for entry in craft.entries.authorId(authorIds).orderBy('dateCreated desc').all() %}
                        
      {% if entry.section.handle == 'projects' %}

         Do something
    
      {% elseif entry.section.handle == 'events' %}

         Do something different

      {% endif %}

{% endfor %}