cracking in welding can be caused by many factors depending on the materials used, welding process, environment the weld is being exposed to etc. Welding can induce thermal stresses that can lead to cracking. In steels hydrogen induced cracking can happen. Also why the crack propagates the way it does? all materisl crack in a place where tension is closest to the limit it can tolerate. Around the welded area inside the base metal there is region called heat affected zone which is weakened by the heat of welding. That area is very problematic and almost always weaker than weld and unaffected base metal. That is why crack targets the interface between weld and base mostly.
metals crack due to different reasons. The presence of microstructural cracks is one of them. Cracks due to processing like shrinkage is also a possible reason. Segregation during the cooling process ( the cooling rates is different on the surface than in the center. This causes diffrent structures across the thickness...
As Mohan indicated, there are many reasons for a crack propagating to failure--this is a science in itself. The observation you made of a crack forming in the base metal parallel to a weld can occur when welding high carbon/high strength steel. The metal in the heat affected zone is annealed and a sink for hydrogen. During cool or afterwards, the weak link is put under tension from the cooling of the weld. Cracks can form and grow as the adjacent metal cools rapidly. Preheating the base metal or skip welding are methods of preventing this type of crack.
To give a more appropriate reasoning, can you pl elaborate on the type of crack, location of the crack, composition of base material, filler used, type of welding process employed and preheat, interpass temp., Post heating, PWHT etc. Otherwise the earlier answers are perfectly OK
Many reasons, its a complex problem. The principal strategy is to study the crack: origin, form, surface topography (SEM is necessary)... That information plus a stress analysis (load, stress and deformations - mechanical of materials) can help to know the reason o formation of cracks in welding of metals and alloys.