I used to mix these up. Asking for an AAAA record is a question about the name. Using -6 decides how the question travels to the resolver.
The manual says -4 indicates that only IPv4 should be used, and -6 that only IPv6 should be used. When you do not give a server, dig uses the ones in /etc/resolv.conf, and with either flag only addresses of the matching family are tried. Compare the two:
dig -6 example.com A
dig -4 example.com AAAA
The first asks for an IPv4 address while the query itself goes out over IPv6. The second asks for an IPv6 address over IPv4. Because the two things are independent, you can test the path to your resolver and the answer you get separately.
That helps when IPv6 on your network is only half working. If /etc/resolv.conf lists a resolver with an IPv6 address, this fails or times out when the IPv6 path is broken, while the same query with -4 works:
dig -6 example.com
The SERVER: line in the output shows which address answered, which is worth a look every time.
The caveat comes from the manual: if dig finds no usable server address for the family you chose, it sends the query to the local host. An answer from ::1 or 127.0.0.1 in that line means your real resolver was never asked. Give the server explicitly with @ and a name or address to rule that out.
Further reading: dig manual (-4, -6)
Going deeper: Guide: dig for beginners, look up DNS records and read the answer