anspielen
to pass to
In sports, especially ball games, to pass the ball to a teammate.
Der Verteidiger hat den Stürmer mit einem langen Pass angespielt.
The defender passed to the striker with a long pass.

to pass to / allude to / play briefly
Loading your saved state.
to pass to
In sports, especially ball games, to pass the ball to a teammate.
Der Verteidiger hat den Stürmer mit einem langen Pass angespielt.
The defender passed to the striker with a long pass.

'Anspielen' is a separable verb. The prefix 'an-' comes at the end in a main clause. In subordinate clauses or in the infinitive with 'zu', the verb stays together.
Er spielt seinen Teamkollegen an.
He passes to his teammate.
In the meaning 'auf etwas hindeuten' (to hint at something), 'anspielen' (to allude) is always used with the preposition 'auf' and the accusative. Without 'auf', the verb does not have this meaning.
Mit ihrer Bemerkung spielte sie auf ein altes Problem an.
With her remark, she was alluding to an old problem.
You can recognize the meaning from the context: In sports, a person (accusative) is passed to. With an indirect remark, the preposition 'auf' appears. In a musical context, the object is often a song or an instrument.
Der Pianist spielte nur die ersten Takte an.
The pianist only played the first bars briefly.
In the sports meaning, the person who is supposed to receive the ball is always in the accusative. You 'play someone on' in German: 'jemanden anspielen' (to pass to someone).
Der Mittelfeldspieler spielte die Stürmerin präzise an.
The midfielder passed precisely to the female striker.
to fit / suit / pass
'passen' and 'anspielen' can both describe passing the ball in sports. 'passen' is the simple, general term: you play the ball to a teammate. 'anspielen' puts stronger emphasis on the teammate as the target of the pass, often in a specific game situation. The words can be confused because they are often used for the same action. In everyday language and in training, 'passen' is very neutral; 'anspielen' sounds a bit more precise when you want to say which player is meant to receive the ball.

Kurz vor dem Tor spielt Mehmet den freien Stürmer an.
Just before the goal, Mehmet passes to the unmarked striker.
Beim Basketball passt Tom den Ball schnell zu Lena.
In basketball, Tom quickly passes the ball to Lena.