How does electricity produce magnetisim?
There is neither electricity alone nor magnetism alone produced by it. There exists an inseparable electromagnetic field produced by (moving) electric charges, in mutual interaction with them, and the splitting to its "electric" and "magnetic" parts depends upon the motion of the observer.The concept of electricity alone and magnetism that produces is due to educational reasons, since there is no way to understand this during your school years (except the case to be a genious). In your next years such questions will be the motivation to meet : (1) Maxwell with his famous equations of electrodynamics, a unification of "electricity" and "magnetism" and (2) Einstein with his theory of Special Relativity and his ideas, unification of the 3-dimensional space and 1-dimensional time to the 4-dimensional space-time.
But don't be disappointed by all these. These ideas must not prevent you from studying the trees :electrostatics (Coulomb's Law etc), magneto-statics (Biot and Savart Law, Faraday's Law etc) and others, in order to see later the forest of Classical Electrodynamics (Maxwell's Equations etc) inextricably coupled with the theory of Special Relativity.
Don't forget, Ladies and Sirs : we try to answer to a 15 years old boy !!!
It is an observed result that a moving electric charge can produce a magnetic force. As to the 'how', that's a bit troublesome. At this level, one has to accept some things as axiomatic.
As to the force at a distance, this is also true of ordinary electric potential. So magnetic force at a difference should be no more troublesome than electric force at a distance.
I'll attempt to "explain" it as simply as possible but without cheating ("not simpler"). This is indeed not an answer to the "how" does something happen, but rather how physicists describe it.
- in physics, one calls a scalar field a function $\psi:\mathbb{R}^4 \rightarrow \mathbb{R}$ from $\mathbb{R}^4$ to $\mathbb{R}$, (where $\mathbb{R}^4$ is the mathematical object corresponding to "space-time", i.e. a set of points whose position is given by 4 numbers, the first coordinate being the time t, and the 3 others the (x,y,z) coordinates). One could also consider a function from space $\mathbb{R}^3$ only, to $\mathbb{R}^3$
This notion allows to describe for example the evolution the temperature in a room: a temperature scalar field $\psi$ would associate to each point $P\in\mathbb{R}^4$ with "temporal position" $t_P$ and spatial position $(x_P,y_P,z_P)$ the value denoted $\psi(t_P,x_P,y_P,z_P)$ of the temperature at that precise time and spatial position.
In eletromagnetism one needs the notion of vector field: to each point in space-time is associated a vector:
1- the eletric field $\vec{\mathbf{E}}: \mathbb{R}^4 \rightarrow \mathbb{R}^3$ describes the force that is exerted on a charged particule with charge $q$ at space-time position $(x_P,y_P,z_P)$ via the following formula $$\vec{\mathbf{F}} =q \vec{\mathbf{E}}(t_P,x_P,y_P,z_P)$$ $\vec{\mathbf{F}}$ is a vector, it is the mathematical description of the force exerted on a charged particule at position $(x_P,y_P,z_P)$ in presence of the field $\vec{\mathbf{E}}$. The vector $\vec{\mathbf{F}}\in\mathbb{R}^3$ (belongs to $\mathbb{R}^3$), one indeed needs 3 numbers to describe the direction and intensity of a force.
2- The magnetic field $\vec{\mathbf{B}}: \mathbb{R}^4 \rightarrow \mathbb{R}^3$ describes another force that is exerted on charged particles (or also on particles with a magnetic momentum). In the case of charged particles, the formula is given by $$\vec{\mathbf{F}} =q \vec{\mathbf{v}}\wedge \vec{\mathbf{B}}(t_P,x_P,y_P,z_P)$$ where $\vec{\mathbf{v}}$ is the speed of the particle and $\vec{\mathbf{v}}\wedge \vec{\mathbf{B}}$ (also denoted $\vec{\mathbf{v}}\times \vec{\mathbf{B}}$) is some vector defined by some formula which depends on $\vec{\mathbf{v}}$ and $\vec{\mathbf{B}}$, but one can just remember that it is perpendicular to both $\vec{\mathbf{v}}$ and $\vec{\mathbf{B}}$. In particular this formula says that if the particle does not move, the magnetic field has no effect on it.
To summarize, if you are a charged particle with charge $q$ at position $(x_P,y_P,z_P)$ and at that point in space and time $t_P$ there is an electric field with value $\vec{\mathbf{E}}(t_P,x_P,y_P,z_P)$ and a magnetic field with value $\vec{\mathbf{B}}(t_P,x_P,y_P,z_P)$ then you are submitted to the so-called Lorentz force $$\vec{\mathbf{F}} =q \left( \vec{\mathbf{E}}(t_P,x_P,y_P,z_P)+ \vec{\mathbf{v}}\wedge \vec{\mathbf{B}}(t_P,x_P,y_P,z_P)\right)$$
There is a distinct phenomenon: an electron or any charged particle also produces an electric field which is given by the Coulomb law (previously the electric field was a given data, we did not care about how it was produced) $$\vec{\mathbf{E}}_{produced} = \pm \frac{q}{\left\lVert\vec{\mathbf{r}}\right\rVert} \vec{\mathbf{r}} $$ (I'm not sure which sign) where $q$ is the charge, and $\vec{\mathbf{r}}$ is a vector giving the relative position at which we want to know the value of $\vec{\mathbf{E}}$ with respect to the position of the charged particle. $\left\lVert\vec{\mathbf{r}}\right\rVert$ is the norm of a vector, i.e. its length. A more complicated formula gives the magnetic field created by an moving charge.
So an eletric field is different from a magnetic field as to how it affects a charged particle, however there is a relation between the two. All the quantities mentionned depend on the referential, exactly like the notion of speed: if you observe an object, you will not measure the same speed depending on whether you are in a train or fixed at some place. The thing I'll skip now are the arguments, the reasoning that led to the following relation, (wikipedia) between the eletric and magnetic field $\vec{\mathbf{E}}_1,\vec{\mathbf{B}}_1$ in a first referential, and those $\vec{\mathbf{E}}_2,\vec{\mathbf{B}}_2$ in a second: (argument in a few words: "symmetry"of the Maxwell equations) $$ \vec{\mathbf{E}}_2 = \gamma \left( \vec{\mathbf{E}}_1 + \vec{\mathbf{v}} \wedge \vec{\mathbf{B}}_1\right ) - \left ({\gamma-1} \right ) \left( \frac{\vec{\mathbf{E}}_1 \cdot \vec{\mathbf{v}}}{\lVert\vec{\mathbf{v}}\rVert} \right) \vec{\mathbf{v}} $$
$$ \vec{\mathbf{B}}_2 = \gamma \left( \vec{\mathbf{B}}_1 - \frac {\vec{\mathbf{v}} \wedge \vec{\mathbf{E}}_1}{c^2} \right ) - \left ({\gamma-1} \right ) \left( \frac{\vec{\mathbf{B}}_1 \cdot \vec{\mathbf{v}}}{\lVert\vec{\mathbf{v}}\rVert} \right) \vec{\mathbf{v}}$$ (where $\vec{\mathbf{v}}$ now denotes the speed of the second referential relative to the first one (i.e not the same $\vec{\mathbf{v}}$ as before) and $\gamma$ is some function of $\vec{\mathbf{v}}$.) It is based on this formula that people say that eletric and magnetic fields are the same thing. E.g. even if $\vec{\mathbf{B}}_1=0$, but $\vec{\mathbf{E}}_1, \vec{\mathbf{v}} \neq 0$ then $\vec{\mathbf{B}}_2\neq 0$, in words even if in a first referential there were no magnetic field but there is an eletric field, then in a second referential that is moving you will observe a magnetic field.