The three-dimensional equations of ideal hydrodynamics and ideal MHD are expanded in eigenfunctions of the curl, and the resulting basic interactions of these nonlinear systems are analysed. As the equations are invariant under time and amplitude reversal, a criterion defining the arrow of time is introduced. A new parameter, the center of energy, serves to characterize a basic interaction. In the 3D Euler equations we find four different interactions and their mirror images, two of which can transport energy to smaller wavenumbers. This can lead to the appearance of structures in turbulent flow, and throws doubt on a derivation of Kolmogorov's law based on a cascading of energy to higher wavenumbers.In energy the corresponding two-dimensional equations, which are isomorphic to the guiding centre model in plasma physics, only one interaction exists, with a strong inverse cascade, which can lead to accumulation of energy in the spatially largest accessible modes. In MHD theory it is possible to separate magnetic from kinetic interactions. The former give again four basic interactions, two being regular and two being inverse cascades. One of these is quite strong, and can lead to the MHD dynamo effect. Kinetic energy can be transferred into magnetic energy. The dynamo effect is is accompanied by alignment of velocity and magnetic fields. We show that stationary velocity fields may lead to exponentially growing magnetic fields and we give an explicit criterion for this instability.