The *big* discrepancy between 512GB and the 494GB or whatever you actually see on "Macintosh HD" is that - as
@EugW said - there is a hidden ~5.4 GB recovery partition which lets you boot so you can re-install MacOS over the network. Not sure about the 512GB advertised vs. the 500.28 GB that its showing for the drive. My 1TB studio just shows 1TB (i.e. 1000 GB).
If you option-click on the Apple menu, choose "System Information" and then select "NVMExpress" and then "Apple SSD Controller" you should get the actual number of bytes on the SSD. I get "1 TB (1,000,555,581,440 bytes)" - a figure that I am at a loss to explain in terms of powers of two or 10
but it's quite possible that the SSD has some over-provisioning or allowance for dead cells.
"Over-provisioning" means leaving some of the SSD unformatted so the SSD can never get physically 100% full: SSDs can't actually function without some spare blocks to move data around - roughly speaking, in order to change existing data they have to copy a large block of data to a blank block along with the changes, then wipe the original. If an SSD ever got 100% full, you'd no longer be able to change anything on it without erasing and losing large blocks of data. So, when you manually partition a SSD you might leave, say, 5% unallocated to avoid this -
but many SSD controllers have this margin baked in (or set via firmware).