The purpose of data driven methods like training a model is that we want to be able to predict an output from a particular given input,
$$y = f(x).$$
The problem is that many relationships and dependencies cannot properly be captured by a simple model $f$. Thus, we introduce millions (or even billions) of parameters that we then tune. Tuning these parameters mean that we do computations on training data, and store these numbers somewhere. In the final step, we get a model $f$ that can predict an outcome or classify novel input data.
But if the relationships are very complex (as in the case of a lava lamp, which in most cases is consider a chaotic system), not even a very complex model $f$ can predict an outcome accurately.
You could of course model and simulate a lava lamp, but machine learning tries to abstract all that away and just look at the data. The central idea in machine learning is that the training examples are drawn from an underlying, typically unknown probability distribution that is assumed to represent the overall space of possible occurrences. The objective is then to construct a generalizable model of this space, enabling it to generate accurate predictions for previously unseen instances.
On one extreme you have empirical models (these are the typical AI models, like decision trees or LLMs). Empirical models are mathematical representations based on observed data and experiments rather than theoretical principles. They are created by fitting a mathematical equation to collected datasets, often using regression techniques, to predict outcomes for specific situations.
The other extreme are physical/mechanistic models. A mechanistic model is a mathematical or computational representation of a system. These models use equations and simulations to represent how a system works. Unlike empirical models that focus solely on data patterns, mechanistic models are built on established physical laws and mechanisms. Simulations are mechanistic models.
An outline of the methodological differences are shown in this picture (fig. 1 in this paper), as seen from biologists trying to model parasitic infections:

In reality, all models are on a continuous spectrum between these two extremes. Which approach you choose depends on what you are trying to do, and both approaches have their pros and cons.
This paper, with the figure below, summarizes it well (they discuss various models in the context of biological systems):
A predictive model might be selected for forecasting future process performance, while descriptive models might offer a greater understanding of relationships within a process (Tsopanoglou and Jiménez del Val, 2021; Sansana et al., 2021). Data availability is also a key concern; depending on the model type, there are limitations based on the quality and quantity of the data. For example, empirical models (Fig. 3) are best suited to processes with a large amount of experimental or observation data, for which mechanistic models consistently fail to predict outcomes; conversely, mechanistic models are derived from theoretical principles and are preferred when the data is lacking, coupled with a strong understanding of the mechanisms of the process, which quantitatively matches well reality (Tsopanoglou and Jiménez del Val, 2021; Sansana et al., 2021). In practice, every model is somewhere on the spectrum between purely empirical and mechanistic.

Returning to your original question, why can't an artificial neural network figure out what a lava lamp will do next?
Your lava lamp example is a case when empirical-faithful models tend to perform very poorly. This is because the interactions are very complex and hard to distill just looking at data. There is no "simple rule" for a machine learning model to learn.