Ansible fetch all vars files from a directory to generate a combined vars file
Sounds like you want the combine filter.

You could read each file into a specific variable, then use the combine filter to create all-pets. At that point, it would be in memory of course, so you might want to use the answer to this question to write it to a file:

- name: Read vars
  include_vars:
    file: "pets/{{ item }}_pets.yml"
    var: "{{ item }}"
  loop:
    - steves
    - jacks

- name: Combine vars
  set_fact:
    all_pets: {{ steves | combine(jacks) }}


- name: Write the file
  copy:
    content: "{{ all_pets | to_yaml }}"
    dest: pets/all_pets.yml