They can extract DNA from bones or fragments of bones and then compare to modern humans. The DNA may be incomplete and so forth but the size of the bone or fragment doesn't matter, the DNA would be the same throughout the entire skeleton and the rest of the body too. It used to be that they could only study the bones themselves but that is a long time ago.