The problem of dangling references is essentially the same as the problem of dangling pointers.
For example, two functions
int &GetReference()
{
int x; // local variable
return x;
}
int *GetPointer()
{
int x;
return &x;
}
cause exactly the same problems for the caller if the returned reference is used, or the pointer dereferenced.
int &r = GetReference();
int *p = GetPointer();
r = 52;
*p = 42;
Both of the assignments exhibit undefined behaviour, since the variables named x (within the two functions) no longer exist, as far as the program is concerned. However, the code can SEEM to work correctly.
The same can happen with creating dangling references or pointers by releasing dynamically allocated memory (free() in C, operator delete in C++).
If other code (eventually) uses that memory (e.g. to represent another variable, to represent an unrelated object), that reference or pointer does often have access to whatever is at that memory location. That can give spurious problems of the value changing (which can give surprises for code using the reference, or for the unrelated code that finds variables or objects being changed).
It is not something to aspire to, or to use, practically. It is a dangerous program flaw that is often very hard to fix or debug - because it provides a path for two completely unrelated sections of code to affect data used by the other.
Fortunately, modern compilers usually (if configured to give maximum warning levels) do give warnings about a lot of suspicious constructs (e.g. returning a pointer or reference to a local variable).