Karma is formed when there is intentions. It has always been.
There are three kinds of karma, Mind, Speech, Action karma.
When ignorance arises out of cause and conditions, it sets up a
'chain reaction' known as the 12 interdependant origination, and
the sentient being keeps on accumulating karma until his liberation
and enlightenment.
If karma is not fate or predestination, then what is it? Let us
look at the term itself. Karma means action, means "to do".
Immediately we have an indication that the real meaning of karma is
not fate because karma is action. It is dynamic.
But it is more than simply action because it is not mechanical
action. It is not unconscious or involuntary action. It is
intentional, conscious, deliberate, wilful action. How is it that
this intentional, wilful action conditions or determines our
situation? It is because every action must have a reaction, an
effect. This truth has been expressed in regard to the physical
universe by the great physicist Newton who formulated the law which
states that every action must have an equal and opposite reaction.
In the moral sphere of conscious actions, we have a counterpart to
the physical law of action and reaction, the law that every
intentional, wilful action must have its effect. This is why we
sometimes speak either of Karma-Vipaka, intentional action and its
ripened effect, or we speak of Karma-Phala, intentional action and
its fruit. It is when we speak of intentional action together with
its effect or fruit that we speak of the Law of Karma.
But if your question is the first-cause question, then perhaps
this one shld answer you.
"To those who talked about the first cause of this world, the
Buddha responded by saying that it is impossible to find a first
cause since everything is changing, interdependent and conditioned
by other things. Something that acts as the cause in the present
may become the effect in the future. Later that same effect may
again become the cause. Such phenomenon continues ad infinitum. It
is called the universal law of Anicca or impermanency.