How database buffer pool work?
The amount of memory specified in innodb_buffer_pool_size is allocated when the MySQL Server daemon starts up, and if the system doesn't have that much memory free at that moment, MySQL won't start.

The amount of memory you specify is what the buffer pool gets, and it neither grows nor shrinks.  

InnoDB reads pages from disk into the pool as they are needed for queries, and the data remains in the pool for future queries until the least-recently-used data is eventually evicted by different data, when the pool is out of space... but the allocated memory is not available for any other process.

MySQL will request additional memory from the system for various other buffers needed by individual threads, but when the buffer pool itself is exhausted for space, no additional memory will be used for storing cached table pages.  Anything that doesn't fit into the buffer pool will not persist in memory for subsequent access.

Ideally MySQL runs on its own hardware.  An environment where MySQL is competing with other processes for memory is not optimum.  This is particularly true with a web server like Apache on the same machine, which commonly causes problems under load, because both the web server and the database are making demands for memory at the same time.