LLDP is a protocol that runs on various networking devices. It sends regular advertisements out ethernet interfaces which a neighbouring device also running LLDP will receive. These advertisements contain a few details about the device sending it.
For the phones running LLDP, the thing they are looking fo rin the LLDP advertisements from the switch they are connected to is a line to the effect, "VLAN20 VOICE".
The phone sees this and configures its LAN-facing interface to be tagged in VLAN20.
Then, the phone can send a DHCP request out VLAN20 and get assigned an IP address in the Voice VLAN subnet.
Alternatively, if there is no LLDP, the phone will not learn any VLAN ID, so it will send a DHCP request out its LAN-facing interface within untagged frames. This request will go to the Data VLAN DHCP scope, and the phone will be assigned an IP address within the Data subnet. The DHCP offer will contain Option125, including the correct VLAN ID for the Voice VLAN. The phone will assign the Voice VLAN ID to itself and add it as a tagged VLAN to its LAN-facing interface, and then reboot itself, coming up in the Voice VLAN, and then sending a DHCP request off into the Voice VLAN so it can get a Voice VLAN subnet IP address.
If you're seeing the phone in both scopes on the DHCP server, it could be either the second process is what's happening, or your DHCP server is patched to a switchport that is misconfigured with multiple VLANs assigned to it.