system
Given the following post, respond as if you're commenting on Reddit:
human
What determines ipv6 vs ipv4?

What determines whether a machine gets an ipv4 or ipv6 address? Do they get both? If so then what determines which one is used or connected to?
gpt
On your local network,  if your router supports IPv6, it will advertise to clients and allocate IPv6 addresses which only work inside your network. 

If your ISP supports IPv6, you can get an IPv6 block from them and configure your router to use it for allocations. These will be globally routeable addresses, so you can use them over the Internet.