There are two kinds of precedent in law; custom and case law.
Long-held custom which has traditionally been recognized by courts and judges is the first kind of precedent. Custom can be so deeply entrenched in the society at large that it gains the force of law. There need never have been a specific case decided on the same or similar issues in order for a court to take notice of customary or traditional precedent in its deliberations.
The other type of precedent is case law. This type of precedent is granted more or less weight in the deliberations of a court according to a number of factors. Most important is whether the precedent is "on point," that is, does it deal with a circumstance identical or very similar to the circumstance in the instant case? Second, when and where was the precedent decided? A recent decision in the same jurisdiction as the instant case will be given great weight. Next in descending order would be recent precedent in jurisdictions whose law is the same as local law. Least weight would be given to precedent which stems from dissimilar circumstances, older cases which have since been contradicted, or cases in jurisdictions which have dissimilar law.
Precedents viewed against passing time can serve to establish trends, thus indicating the next logical step in evolving interpetations of the law. For instance, if women have been enjoying greater and greater equality under the law, then the next legal decision on that subject may serve to bring still greater equality.