Now, there are a couple ways a gene could be different without altering the protein's function. It turns out multiple codons can code for the same amino acid. So if you switch out one codon for another which codes for the same amino acid, obviously you get a chemically identical sequence and therefore the exact same protein. The other way is you switch an amino acid, but this doesn't meaningfully affect the folded 3D structure of the finished protein, at least not in a way that alters its function. Both these types of mutations are quite common; because they don't affect function, they're not "weeded out" by evolution and tend to accumulate over evolutionary time.
* except for a few that are known as start and stop codons. They delineate the start and end of a gene.
You could build houses from bricks, timber or poured concrete that all looked the same in the end. Their internal structures and methods of construction would be different, but they would have the same form.
I'm reading the GP's comment similarly.
genes are instructions for building proteins.
For a given output, you could write a program in wildly different programming languages, or even use the same language but structure it in wildly different ways.
If there's no match for the source code (genes), then find a match for the output (protein).
Source: Am structural biochemist
Non-polar
Polar
Acidic
Basic
In terms of 3D fold - i.e. the general abstract shape of the protein in 3D, you can make loads of substitutions without changing it, generally as long as you stay within the same class.
It's not until you compare the 3D shape that you see the relationship.