I think this is a fairly common observation that if one does some significant amount of exercise, he/she may feel alright for the rest of the day, but it  generally hurts bad the next day. Why is this the case?

I would expect that if the muscles have undergone significant strain (say I started pushups/plank today), then it should cause pain while doing the strenuous activity, or during rest of the day, but it happens often that we don't feel the pain while doing the activity or even on that day, but surely and sorely feel it the next day.

Another example - say after a long time, you played a long game of basketball/baseball/cricket. You generally don't feel any pain during the game/that day, but there is a good chance it will hurt bad the next day.

I am trying to understand both - why does the pain not happen on that day, and why it does, the next day (or the day after that).

Unlike the conventional wisdom, the pain you feel the next day (after a strenuous exercise) has nothing to do with lactic acid. 

Actually, lactic acid is rapidly removed from the muscle cell and converted to other substances in the liver (see Cori cycle). If you start to feel your muscles "burning" during exercise (due to lactic acid), you just need to rest for some seconds, and the "burning" sensation disappears.

According to Scientific American:


  Contrary to popular opinion, lactate or, as it is often called, lactic acid buildup is not responsible for the muscle soreness felt in the days following strenuous exercise. Rather, the production of lactate and other metabolites during extreme exertion results in the burning sensation often felt in active muscles. Researchers who have examined lactate levels right after exercise found little correlation with the level of muscle soreness felt a few days later. (emphasis mine)


So if it's not lactic acid, what is the cause of the pain?

What you're feeling in the next day is called Delayed Onset Muscle Soreness
 (DOMS).

DOMS is basically an inflammatory process (with accumulation of histamine and prostaglandins), due to microtrauma or micro ruptures in the muscle fibers. The soreness can last from some hours to a couple of days or more, depending on the severity of the trauma (see below).

According to the "damage hypothesis" (also known as "micro tear model"), microruptures are necessary for hypertrophy (if you are working out seeking hypertrophy), and that explains why lifting very little weight doesn't promote hypertrophy.

However, this same microtrauma promotes an inflammatory reaction (Tiidus, 2008). This inflammation can take some time to develop (that's why you normally feel the soreness the next day) and, like a regular inflammation, has as signs pain, edema and heat. 

This figure from McArdle (2010) shows the proposed sequence for DOMS:



Figure: proposed sequence for delayed-onset muscle soreness. Source:
 McArdle (2010).

As anyone who works out at the gym knows, deciding how much weight to add to the barbell can be complicated: too little weight promotes no microtrauma, and you won't have any hypertrophy. Too much weight leads to too much microtraumata, and you'll have trouble to get out of the bed the next day. 

EDIT: This comment asks if there is evidence of the "micro tear model" or "damage model" (also EIMD, or Exercise-induced muscle damage). First, that's precisely why I was careful when I used the term hypothesis. Second, despite the matter not being settled, there is indeed evidence supporting EIMD. This meta-analysis (Schoenfeld, 2012) says:


  There is a sound theoretical rationale supporting a potential role for EIMD in the hypertrophic response. Although it appears that muscle growth can occur in the relative absence of muscle damage, potential mechanisms exist whereby EIMD may enhance the accretion of muscle proteins including the release of inflammatory agents, activation of satellite cells, and upregulation of IGF-1 system, or at least set in motion the signaling pathways that lead to hypertrophy. 


The same paper, however, discuss the problems of EIMD and a few alternative hypotheses (some of them not mutually exclusive, though).

Sources: 


Tiidus, P. (2008). Skeletal muscle damage and repair. Champaign: Human Kinetics.
McArdle, W., Katch, F. and Katch, V. (2010). Exercise physiology. Baltimore: Wolters Kluwer Health/Lippincott Williams & Wilkins.
Roth, S. (2017). Why Does Lactic Acid Build Up in Muscles? And Why Does It Cause Soreness?. [online] Scientific American. Available at: https://www.scientificamerican.com/article/why-does-lactic-acid-buil/ [Accessed 22 Jun. 2017].
Schoenfeld, B. (2012). Does Exercise-Induced Muscle Damage Play a Role in Skeletal Muscle Hypertrophy?. Journal of Strength and Conditioning Research, 26(5), pp.1441-1453.

