Dhyana is an Indian Sanskrit (and Pali) term for what today is called meditation, but depending on the sources, religion, spiritual tradition, and/or Yogic lineages it can have slightly different meanings, such as contemplation, concentration, awareness, attention, and/or reflection, among others. The concept and practice of Dhyana appears principally in Hindu, Jain, and Buddhist traditions.
As such, Dhyana can point to a variety of activities, such as non-judgmental observation or awareness; reflecting on a concept or idea pondering over all its aspects, causes, and consequences; withdrawing the mind from automatic responses to sensory impressions; training of the mind; subject-object unification; just to give some examples.
Whatever the case, Dhyana is usually considered one of the most important activities in Indian spiritual and Yogic practices, seen as the preliminary step to Samadhi (a temporary experience, glimpse or state of Spiritual Insight or Self-Realization), which will finally lead to firmly abiding in the Enlightened state called Kaivalya or Moksha.
Moreover, Yogic practices were traditionally all meant as a preparation for meditation or Dhyana. This can be clearly observed in the authoritative Yoga Sutras of Patanjali — the Eight Limbs Yoga — in which Dhyana is the 7th limb of 8th, immediately preceding the last stage or limb of Patanjali’s Yogic practice, which is Samadhi.
Nevertheless, the concept of Dhyana appears already before Patanjali’s Sutras in various Indian Vedic scriptures, even before the birth of the Buddha. It’s, as with many things around the origins of Yoga, still unclear how and when exactly the concept of Dhyana arose, but it’s generally accepted that it was already an important spiritual practice before the 6th century BCE.