Magnetic fields have always been generated by moving charges. For example, a current constitutes moving charges and I hope you might be familiar with the concept of an electromagnet which is a magnetic field being generated around a current carrying conductor on account of moving charges inside it. When you consider a bar magnet. The tiny electrons moving inside the atoms of the magnet are so arranged that the effects due to each electron is added up to form a noticeable magnetic field. Another source of magnetic field is an electric field changing with time, i.e. a time varying electric field.