How are the dates of biblical manuscripts determined and all other ancient manuscripts?
This is a somewhat complex question. A number of factors are used. First is the type of script used. The style of script used in writing changed over time. The way letters were written, the kinds of punctuation (of which there was very little in the Greek, but the Hebrew vowel markings are helpful) and other factors can be used to get a rather approximate date. This is a fairly inexact science, but can establish a date approximately plus or minus 50 to 100 years.
Another kind of evidence is C-14 dating. Depending on the size of the sample, this can give a date plus or minus somewhere around fifty years. This is used infrequently, especially for fragments, as it requires the destruction of a small piece of the manuscript. There is the additional technical detail that there is some doubt about whether the amount of C-14 in the naturally-occurring carbon in plants is constant over time, which adds a bit of uncertainty. Generally, though, C-14 is the gold standard for dating manuscripts.
After about AD 1000, copyists began to provide actual dates that they completed their copying, which is really helpful, but this practice developed in the second millennium, so is of limited helpfulness for us.
In a few situations, a lower limit for the age (ie. the latest, not the earliest date) can be obtained by the physical situation where the manuscript was found. If we know when the manuscript was put in the location where it was found, this gives the lower limit. This applies to the Dead Sea Scrolls.
If you read scholarly articles, you will find that good scholars attach plus or minus approximations to the ages they report for the various important manuscripts. Popular writers usually leave off this important information. For example, they will say something like the Rylands Papyrus is from about AD 125, whereas scholarly treatment will say that the manuscript is from between AD 100 and 150. This is based almost exclusively on the type of handwriting used, making it somewhat open to criticism.