Flint is chert from a spedific set of beds within the cretaceous chalk, but as minerals they are identical.
The deposit is a secondary mineral in most instances, formed from remobilised SiO2, which came from silica sediment or silica rich skeletons (eg radiolaria). It is commonly seen to form inconsisitent layers and nodules which cut across bedding, thought to be the redox fronts within the groundwater. The silica in solution will tend to stick together to form a hydrated gel which sets as the chemistry changes to form a crypto crystalline hydrate. magnetism is not invloved. The micro structure of chert is like tiny spheres of amorphous silica hydrate with no macro structure or crystallinity, hence having a glassy fracture and appearence. Relatively commonly the chert will form around an incosistency in the rock, such as a fossil, organic debris, worm tubes, etc
The silica is sticky, it sets as the groundwater changes to form chert, which is also called flint in some places...