Interesting question. The bible (as I see it anyway) presents a few different related ideas - a kind of psychotic fugue state (Nebuchadnezzar II in the book of Daniel), instances of what might be taken as epileptic fits (Mark 9) and other cases that are clearly meant to represent possession by an evil spirit or spirits (legion - Mark 5). In other parts of the bible 'spirit' is used to refer to things like the spirit of the age, the spirit that guides a person and so on, to do with behaviours prompted by different spiritual influences, which seems to encapsulate a lot of different things including thinking and emotion as well as the influence of spiritual forces, however when it comes to people acting in ways considered evil or destructive there is more a blend of individual behaviours that leave a person open to or lead to these influences having some sort of sway, as in James 1:14-15 and Luke 22:3. Sin itself is sometimes referred to as if it were an entity or force of some sort, as in Genesis 4:7, but that may just be figurative. Satan as 'the accuser' in Job is also, I think, figurative in that Job is a book of philosophy and the character role is a device used to expound part of the overall idea. There are also comparisons in the bible between the ideas of spiritual powers/ magical powers / fake trickery, as with the so-called Simon the Sorcerer in Acts 8, there being the idea that there were then as now claims about real vs fake spiritual phenomena.
This article was referenced in a recent thread on this topic
https://www.washingtonpost.com/post...tal-illness-and-sometimes-demonic-possession/ , so you might find that interesting, or this one which is not about demons but related ideas about supernatural experiences:
The Psychiatrist Who Believed People Could Tell the Future
More specifically while the bible references all of the above it doesn't give a clear definition of what exactly is meant in a modern sense, these ideas evidently had a meaning in the context of the time, and that doesn't seem to be all that different to what people take them to mean in a very broad sense, i.e. things from a spiritual dimension that interact in some ways with the material world.