In many cases it is known which sources Shakespeare used to build his plays. MacBeth came from Holinshed's Chronicles of England. Julius Caesar was based on a translation from Plutarch. His plays are not useful as sources of knowledge about the historical persons themselves.
They do, however, tell us is a lot about the perceptions of these people in Shakespeare's day. Richard III was probably not as bad as Shakespeare made him out to be, but by making him the villain of the War of the Roses, it adds to the legitimacy of Elizabeth's reign.